In [ ]:
 

ANEOS FORSTERITE MODEL DEVELOPMENT NOTEBOOK

Sarah T. Stewart
sts@ucdavis.edu

ANEOS Parameters Version: Forsterite STS SLGDF2.0
Jupyter Notebook Version: v2.0
Updated 7/12/2019

This is a solid-liquid-gas ANEOS model with ionization and user-defined heat capacity limit for pure forsterite (Mg$_2$SiO$_4$).

This Jupyter notebook was used to develop new input parameters for the forsterite EOS to optimize for the liquid and vapor regions for impact simulations where the silicate is melted and partially vaporized upon shock and decompression.

Usage:
This notebooks calls a local aneos executable (MacOS provided) which expects an ANEOS.INPUT ascii file and produces an ANEOS.OUTPUT ascii file and gridded EOS tables.
The user edits (1) the input parameters in ANEOS.INPUT (separately from this notebook) and (2) the output EOS table parameters in the input cell below.
The notebook read some parameters from ANEOS.INPUT and assumes that the variables are spaced by 10 columns.
Run this notebook. The notebook issues a system call to run the aneos program in the local directory and reads in results from the ANEOS.OUTPUT file and NEW-SESAME.TXT file to make the plots below.

Output:
This notebook produces plots of the equation of state model and comparisons to experimental data and ab initio calculations.
Ourput files:
ANEOS.OUTPUT: plain text file with an overview of the calculated equation of state
NEW-SESAME.TXT: extended length SESAME table with extra variables from ANEOS (pressure, sp. internal energy, sp. free energy, sp. entropy, sound speed, sp. heat capacity, KPA flag)
NEW-SESAME-STD.TXT: standard length Sandia-style SESAME table (pressure, internal energy, Helmholtz free energy)
NEW-SESAME-STD-NOTENSION.TXT: standard length Sandia-style SESAME table (pressure, internal energy, Helmholtz free energy) where the ANEOS tension region is removed and replaced with sublimation curve.
NEW-GADGET2-NOTENSION.TXT: standard GADGET2 EOS table using the notension ANEOS.

Development notes:
The reference state is the solid at the melting point. As a compromise to span the whole phase diagram, the reference bulk modulus is lower than the true value. The Debye temperature is fitted to attain the true specific entropy at melting with a single solid phase.

WARNING:
When a melt curve is present, a tabulated EOS must be sufficiently densely gridded to capture the phase boundary. Otherwise, non-physical material response can arise during problems that cross the phase boundary.

Applications:
This EOS table is appropriate for problems where forsterite is present as a warm solid near the melt curve, liquid, and partially vaporized. The temperatures in the liquid field are much improved with the adjustable heat capacity. The critical point is much improved over previous version of forsterite ANEOS used in modeling impact processes. The bulk modulus is a compromise to produce a model that spans a wide range of P-V-T and accommodates the limits of the Gruneisen function in ANEOS. As a result, the sound speeds in the solid are too low and the sound speeds in the liquid are too high.

This model does not include a solid-solid/liquid-liquid transition to avoid the artificial discontinuities introduced in the liquid field. This model becomes increasingly erroneous for shock pressures above about 1000 GPa as the curvature on the Hugoniot and the Grueneisen parameter model are not correct.

This model is not appropriate for problems entirely in solid forsterite. The modulus of the solid is incorrect and high-pressure polymorphs are neglected.

The Gruneisen function in ANEOS does not do a good job of matching the experimental values for forsterite. The values are too large at low density. Since the bulk modulus is also too large for the low-pressure liquid, the two errors partially compensate for each other.

ANEOS:
The ANEOS source code was obtained from https://github.com/isale-code/ANEOS courtesy of Jay Melosh and Gareth Collins. This version includes Melosh's (2007) treatment for molecular gas and the capability to include a melt curve and solid-solid/liquid-liquid transition (Collins & Melosh LPSC 2014).
The Melosh and Collins version of ANEOS was modified to adjust the Debye free energy term to approach a user-defined heat capacity at high temperatures. The multiplicative factor $H_c$ is entered in input value V44, and the high-temperature heat capacity is $3H_cNk$.

The ANEOSTEST.f routine was modified to output tabulated EOS. Note that the current version of this script sets positive pressures smaller than 1.E-20 GPa equal to 1.E-20 GPa. The current version does not have a 0 K temperature column.
ANEOS2.f was modified to increase the number of points tabulated on the melt curve in the ANEOS.OUTPUT file and to gather the variables for the heat capacity modification.
ANHUG.f was modified to output more Hugoniot points.
ANEOS1.f was modified to increase the high temperature limit for the heat capacity (Stewart 2019).

FINAL WARNING:
The units vary between codes and data sources. Always check and declare the units.

In [1]:
from IPython.display import HTML

HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')
Out[1]:
In [2]:
# import libraries
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from scipy import interpolate
import colormaps as local_cmaps
import subprocess
import pandas as pd

from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle

plt.rcParams["figure.figsize"] = (20,10)

# define index function (must be a more efficient way to do this...)
get_indexes = lambda x, xs: [i for (y, i) in zip(xs, range(len(xs))) if x == y]

USER INPUTS FOR SESAME TABLE

  1. Header information
  2. temperature-density grid

Enter the desired grid spacing in temperature and density for a SESAME-style EOS table in the (possibly hidden) input cell below this text.

In [3]:
#-------------------------------------------------------------
# USER MUST SET THESE VALUES TO DEFINE THE TABULATED EOS GRIDS
#-------------------------------------------------------------
#
# Header information must all be compatible with float format
MATID = 1.0        # MATID number
DATE = 190602.     # Date as a single 6-digit number
VERSION = 1.1      # ANEOS Parameters Version number
FMN = 70.          # Formula weight in atomic numbers for Mg2SiO4
FMW = 140.691      # Formula molecular weight (g/cm3) for Mg2SiO4
# The following define the default initial state for material in the 201 table
# For this set of ANEOS parameters, this is the solid at the melting point with the compromise bulk modulus
RHO0REF = 2.9      # g/cm3
K0REF   = 0.5E12   # dynes/cm2
T0REF   = 2163.    # K
#
# Flag for easily switching between different table grids
# 0: low res for testing
# 1: high res for production
# 2: medium resolution
gridflag = 2
#
#------------------------------------------------------
if gridflag == 0: # low res for testing
    # temperature array: linear region + log region (with 298 K inserted)
    nlinsteps = 100. # number of linear points (will be +1 for 298 if not already present)
    gridtlinmax = 15000. #K  maximum temperature in linear region 
    nlogsteps = 50 # number of log points
    gridtmax = 1.e7 #K maximum temperature in log region
    # density array: log region + linear region 1 + linear region 2
    gridrmin = 1.e-20 # g/cm3 minimum density in the table
    gridrlog1 = 0.1 # g/cm3 end of log region
    nlogsteps = 30 # number of points in the log region
    gridrlin1 = 15. # g/cm3 density at end of first linear region
    nlinsteps1 = 100. # number of linear points from gridrlog1 to gridrlin1
    gridrlin2 = 30. # g/cm3 density at end of first linear region
    nlinsteps2 = 20. # number of linear points from gridrlog1 to gridrlin1

if gridflag == 1: # high resolution grid
    # temperature array: linear region + log region (with 298 K inserted)
    nlinsteps = 600. # number of linear points (will be +1 for 298 if not already present)
    gridtlinmax = 20000. #K  maximum temperature in linear region 
    nlogsteps = 300 # number of log points
    gridtmax = 1.e7 #K maximum temperature in log region
    # density array: log region + linear region 1 + linear region 2
    gridrmin = 1.e-20 # g/cm3 minimum density in the table
    gridrlog1 = 0.1 # g/cm3 end of log region
    nlogsteps = 200 # number of points in the log region
    gridrlin1 = 15. # g/cm3 density at end of first linear region
    nlinsteps1 = 600. # number of linear points from gridrlog1 to gridrlin1
    gridrlin2 = 30. # g/cm3 density at end of first linear region
    nlinsteps2 = 40. # number of linear points from gridrlog1 to gridrlin1

if gridflag == 2: # medium resolution grid <1E7 entries in 301 table
    # define the temperature array for the SESAME table
    # 0 K is changed to 1 K
    # 298 K is inserted into the table if it is not present in the original array
    gridtvals  = [0, 10000., 20000.,1.e7] # K -- this array defines the edges of the segments along the grid, 0 is changed to 1 below
    gridtstyle = [1,1,0] # 1 for linear, 0 for log in each segment
    gridtnpts  = [200.,200.,150.] # number of grid points in each segment
    # define the density array for the SESAME AND GADGET2 tables
    # 0 g/cm3 is removed if present
    gridrvals  = [1.e-20, 0.1, 2.6, 3.2, 10., 30.] # g/cm3 -- this array defines the edges of the segments along the grid
    gridrstyle = [0, 1, 1, 1, 1] # 1 for linear, 0 for log in each segment
    gridrnpts  = [150, 76, 54, 206, 40] # number of grid points in each segment
    # define the specific entropy array for the GADGET2 table
    # 0 MJ/K/kg is removed if present
    gridsvals  = [0.,0.03] # MJ/K/kg -- this array defines the edges of the segments along the grid
    gridsstyle = [1] # 1 for linear, 0 for log in each segment
    gridsnpts  = [500] # number of grid points in each segment

#----------------------------------------
#----------------------------------------
#
# CODE GENERATES THE GRID AND WRITES TO A FILE TO BE READ BY ANEOS
print('TABULATED EOS GRID SETUP')
#-------------- the following code generates the temperature array
gridtarr = []
for iir in range(1,len(gridtvals)):
    if gridtstyle[iir-1] == 1:
        # linear region
        temptarr = np.arange(gridtnpts[iir-1])/gridtnpts[iir-1]*(gridtvals[iir]-gridtvals[iir-1])+gridtvals[iir-1]
    if gridtstyle[iir-1] == 0:
        # log region
        logstep = (np.log10(gridtvals[iir])-np.log10(gridtvals[iir-1]))/gridtnpts[iir-1]
        temptarr = np.power(10.,np.log10(gridtvals[iir-1])+(np.arange(gridtnpts[iir-1]))*logstep)
    gridtarr = np.concatenate((gridtarr,temptarr))
# check if 298 already in the grid
index298 = get_indexes(298.,gridtarr)
if len(index298) == 0:
    # insert 298 K into the array
    index298 = int(np.round(np.interp(298,gridtarr,np.arange(len(gridtarr)))))
    gridtarr = np.concatenate((gridtarr[0:index298],[298.],gridtarr[index298::]))
    print('inserted 298 K:',gridtarr[index298-2:index298+3])
# Remove 0 K or convert to 1 K
indexzero = get_indexes(0.,gridtarr)
indexone = get_indexes(1.,gridtarr)
if len(indexzero) == 1 and len(indexone) == 0:
    gridtarr[indexzero] = 1.
    print('Zero kelvin changed to 1 kelvin.')
else:
    gridtarr = np.delete(gridtarr, indexzero)
    print('Deleted zero K index.')
#
print('Number of temperature points: ',len(gridtarr))
#print(gridtarr)
#------------ the following code generates the density array
gridrarr = []
for iir in range(1,len(gridrvals)):
    if gridrstyle[iir-1] == 1:
        # linear region
        temprarr = np.arange(gridrnpts[iir-1])/gridrnpts[iir-1]*(gridrvals[iir]-gridrvals[iir-1])+gridrvals[iir-1]
    if gridrstyle[iir-1] == 0:
        # log region
        logstep = (np.log10(gridrvals[iir])-np.log10(gridrvals[iir-1]))/gridrnpts[iir-1]
        temprarr = np.power(10.,np.log10(gridrvals[iir-1])+(np.arange(gridrnpts[iir-1]))*logstep)
    gridrarr = np.concatenate((gridrarr,temprarr))
# Remove 0 g/cm3 if present
indexzero = get_indexes(0.,gridrarr)
if len(indexzero) == 1:
    gridrarr = np.delete(gridrarr, indexzero)
    print('Deleted zero g/cm3 index.')
#
print('Number of density points: ',len(gridrarr))
#print(gridrarr)
#------------ the following code generates the specific entropy array
gridsarr = []
for iir in range(1,len(gridsvals)):
    if gridsstyle[iir-1] == 1:
        # linear region
        tempsarr = np.arange(gridsnpts[iir-1])/gridsnpts[iir-1]*(gridsvals[iir]-gridsvals[iir-1])+gridsvals[iir-1]
    if gridsstyle[iir-1] == 0:
        # log region
        logstep = (np.log10(gridsvals[iir])-np.log10(gridsvals[iir-1]))/gridsnpts[iir-1]
        tempsarr = np.power(10.,np.log10(gridsvals[iir-1])+(np.arange(gridsnpts[iir-1]))*logstep)
    gridsarr = np.concatenate((gridsarr,tempsarr))
# Remove 0 MJ/K/kg if present
indexzero = get_indexes(0.,gridsarr)
if len(indexzero) == 1:
    gridsarr = np.delete(gridsarr, indexzero)
    print('Deleted zero MJ/K/kg index.')
ssize = len(gridsarr)
#
print('Number of specific entropy points: ',len(gridsarr))
#print(gridsarr)

print('Number of words in the standard SESAME 301 table (NR, NT, R, T, P(all R at each T), IE(all R at each T), FE(all R at each T))=',2.+len(gridrarr)+len(gridtarr)+len(gridrarr)*len(gridtarr)*3.)
print('SESAME 301 table units: density (g/cm$^3$), temperature (K), pressure (GPa), specific internal energy (MJ/kg), specific Helmholtz free energy (MJ/kg)')
#-----------------------------------------------------------
# write the table arrays to a file for the ANEOS driver to read in
tablegridfile = open("tablegrid.txt","w")  
tablegridfile.write("{:.6e}".format(MATID)+'\n')  
tablegridfile.write("{:.6e}".format(DATE)+'\n')  
tablegridfile.write("{:.6e}".format(VERSION)+'\n')  
tablegridfile.write("{:.6e}".format(FMN)+'\n')  
tablegridfile.write("{:.6e}".format(FMW)+'\n')  
tablegridfile.write("{:.6e}".format(RHO0REF)+'\n')  
tablegridfile.write("{:.6e}".format(K0REF)+'\n')  
tablegridfile.write("{:.6e}".format(T0REF)+'\n')  
tablegridfile.write("{:.6e}".format(len(gridrarr))+'\n')  # number of density points
tablegridfile.write("{:.6e}".format(len(gridtarr))+'\n')  # number of temperature points
for i in range(0,len(gridrarr)):
    tablegridfile.write("{:.6e}".format(gridrarr[i])+'\n')
for i in range(0,len(gridtarr)):
    tablegridfile.write("{:.6e}".format(gridtarr[i])+'\n')
tablegridfile.close()


#-----------------------------------------------------
# Output GADGET2 Table information
print('Number of words in the GADGET2 EOS table (NR, NS, R, S, P(all R at each S), IE(all R at each S), CS(all R at each S))=',2.+len(gridrarr)+len(gridtarr)+len(gridrarr)*len(gridtarr)*3.)
print('GADGET2 table units: density (g/cm$^3$), specific entropy (MJ/K/kg), pressure (GPa), specific internal energy (MJ/kg), bulk sound speed (cm/s)')
#------------------------------------------------------

#----------------------------------------------------
# Sp. Internal Energy grid for Tillotson
tillearr = np.power(10.,np.arange(500)/500.*5.-2.) # MJ/kg
esize = len(tillearr)
print('Number of specific internal energy points for Tillotson: ',esize)

# END TABLE GRIDDING INFORMATION
TABULATED EOS GRID SETUP
inserted 298 K: [200. 250. 298. 300. 350.]
Zero kelvin changed to 1 kelvin.
Number of temperature points:  551
Number of density points:  526
Deleted zero MJ/K/kg index.
Number of specific entropy points:  499
Number of words in the standard SESAME 301 table (NR, NT, R, T, P(all R at each T), IE(all R at each T), FE(all R at each T))= 870557.0
SESAME 301 table units: density (g/cm$^3$), temperature (K), pressure (GPa), specific internal energy (MJ/kg), specific Helmholtz free energy (MJ/kg)
Number of words in the GADGET2 EOS table (NR, NS, R, S, P(all R at each S), IE(all R at each S), CS(all R at each S))= 870557.0
GADGET2 table units: density (g/cm$^3$), specific entropy (MJ/K/kg), pressure (GPa), specific internal energy (MJ/kg), bulk sound speed (cm/s)
Number of specific internal energy points for Tillotson:  500
In [4]:
# first call to aneos in the local directory
# output file is in the local directory
#"""
completed = subprocess.run(['hostname'],capture_output=True)
#print(completed)
hostname=completed.stdout.decode("utf-8")
if hostname.find('sarah2.geology') == 0:
    print('new desktop')
    completed = subprocess.run(['./aneosd'])
else:
    print('old cpu')
    completed = subprocess.run(['./aneos'])
print('PYTHON SUBPROCESS CALL TO ANEOS PROGRAM. NEW USERS SHOULD CHECK THAT A NEW ANEOS.OUTPUT FILE WAS CREATED.')
print('aneos call result: ', completed.returncode)
#"""
old cpu
PYTHON SUBPROCESS CALL TO ANEOS PROGRAM. NEW USERS SHOULD CHECK THAT A NEW ANEOS.OUTPUT FILE WAS CREATED.
aneos call result:  0
In [5]:
# READ IN ANEOS DATA
aneosinputfile = open("ANEOS.INPUT","r")  
testin=aneosinputfile.readlines()
aneosinputfile.close()
#print(*testin)#,sep = "\n")

aneosoutputfile = open("ANEOS.OUTPUT","r")  
testout=aneosoutputfile.readlines()
aneosoutputfile.close()
#print(*testout)

# TEST WRITE NEW ANEOS INPUT FILE 
#aneosnewinputfile = open("ANEOS.INPUT.NEW","w")  
#aneosnewinputfile.writelines(testin) 
#aneosnewinputfile.close() 
In [6]:
# GUESS A BIG ARRAY SIZE FOR THE PHASE BOUNDARIES AND HUGONIOT IN ANEOS.OUTPUT
# the melt curve, vapor curve and Hugoniot curves are not fixed length outputs
nleninit=300
meltcurve = 0

# Read in data from the ANEOS.OUTPUT FILE
dlen=1.0*len(gridrarr)
tlen=1.0*len(gridtarr)

imc = -1 # flag for no melt curve in the model
for i in np.arange(len(testout)):
    if testout[i].find('  Data for ANEOS number') == 0:
        tmp = testout[i+2][0:50]
        eosname = tmp.strip()
    if testout[i] == '  TWO-PHASE BOUNDARIES\n':
        nvc = nleninit
        ivc = i
        vcarrtmp = np.zeros((nvc,12),dtype=float)
        flag=0
        j=0
        while flag == 0:
            if testout[j+i+4].find(' anphas') == 0:
                print(testout[j+i+4])
                vcarrtmp[j,:]=vcarrtmp[j-1,:]
                j=j+1
            else:
                tmp=str.replace(testout[j+i+4],'D','E')
                tmp3 = tmp[0:157]
                tmp4 = list(tmp3.split())
                if (len(tmp4) >0) and (float(tmp4[3]) > 0) and (float(tmp4[4]) > 0): # stop if the pressures become negative on the vapor curve
                    tmp5 = np.asarray(tmp4)
                    vcarrtmp[j,:] = tmp5[:]
                    j=j+1
                else:
                    flag=1
        vcarr = np.zeros((j,12),dtype=float)
        vcarr[:,:] = vcarrtmp[0:j,:]
    if testout[i] == ' LIQUID/SOLID PHASE CURVE\n':
        nmc = nleninit
        imc = i
        meltcurve=1
        mcarrtmp = np.zeros((nmc,11),dtype=float)
        flag=0
        j=0
        while flag == 0:
            tmp  = str.replace(testout[j+i+5],'D','E')
            tmp3 = tmp[0:132]
            tmp4 = list(tmp3.split())
            if len(tmp4) > 0:
                tmp5 = np.asarray(tmp4)
                mcarrtmp[j,:] = tmp5[:]
                j=j+1
            else:
                flag=1
        mcarr = np.zeros((j,11),dtype=float)
        mcarr[:,:] = mcarrtmp[0:j,:]
    if testout[i] == '   HUGONIOT\n':
        nhc = nleninit
        ihc = i
        hcarrtmp = np.zeros((nhc,9),dtype=float)
        flag=0
        j=0
        while flag == 0:
            tmp=str.replace(testout[j+i+5],'D','E')
            tmp3 = tmp[0:109]
            tmp4 = list(tmp3.split())
            if len(tmp4) > 0:
                tmp4[3]='0.0' # this column often gives problems with exponential notation so don't read it
                tmp5 = np.asarray(tmp4)
                hcarrtmp[j,:] = tmp5[:]
                j=j+1
            else:
                flag=1
        hcarr = np.zeros((j,9),dtype=float)
        hcarr[:,:] = hcarrtmp[0:j,:]
# Gather parameters for the gamma function
aneoscount=1
for i in np.arange(len(testin)):
    if testin[i].find('ANEOS') == 0:
        if aneoscount<9:
            print(' '+testin[i-3],testin[i-2],testin[i-1],testin[i])
            aneoscount=aneoscount+1
        else:
            print(' '+testin[i])
        if testin[i].find('ANEOS2') == 0:
            tmp=testin[i]
            nelem=int(tmp[10:20])
            #print('nelem=',nelem)
            rho0=float(tmp[30:40])
            #print('rho0=',rho0)
            gamma0=float(tmp[70:80])
            #print('gamma0=',gamma0)
            theta0=float(tmp[80:90])
        if testin[i].find('ANEOS3') == 0:
            tmp=testin[i]
            C24=float(tmp[20:30])/3.
            #print('C24=',C24)
        if testin[i].find('ANEOS5') == 0:
            tmp=testin[i]
            C60=float(tmp[60:70])
            C61=float(tmp[70:80])
            #print('C60=',C60)
        if testin[i].find('ANEOS7') == 0:
            tmp=testin[i]
            betagamma=float(tmp[70:80])


#=============================================================
# READ IN NEW SESAME EOS TABLE GENERATED BY ANEOS FROM NEW-SESAME.TXT
#
sesamefilename='NEW-SESAME.TXT'
sesametxt = open(sesamefilename,"r")  
testout=sesametxt.readlines()
sesametxt.close()
#
nskip = 6
# num.density, num. temps
tmp = testout[nskip][0:16]
dlen = float(tmp)
tmp = testout[nskip][16:32]
tlen = float(tmp)

neos = int((dlen*tlen*7.0+dlen+tlen+2.0)/5.0)+1
#print(dlen,tlen,neos)
eosarr = np.zeros((neos,5),dtype=float)
for j in range(nskip,neos+nskip):
    tmp3 = testout[j]
    tmp4 = list(tmp3.split())
    if len(tmp4) < 5:
        lentmp4 = len(tmp4)
        eosarr[j-nskip,0:lentmp4] = np.asarray(tmp4[0:lentmp4])
    else:
        eosarr[j-nskip,:] = np.asarray(tmp4)        
    #print(j,eosarr[j,:])

print('\n\nLoaded ANEOS Model for Material: '+eosname)
print('===> Check last line in EOS table:',testout[j],eosarr[j-nskip,:])

ndat = dlen*tlen*7.0+dlen+tlen+2.0
#print(ndat)
allarr=np.resize(eosarr,int(ndat))
dsize = int(allarr[0])
tsize = int(allarr[1])
#print(dsize)
#print(tsize)
#print(dsize*tsize*7+dsize+tsize+2)
andarr = np.zeros(dsize) # density g/cm3
antarr = np.zeros(tsize) # K
anparr = np.zeros([tsize,dsize]) # pressure in GPa
anearr = np.zeros([tsize,dsize]) # internal energy in MJ/kg
anaarr = np.zeros([tsize,dsize]) # Helmholtz free energy in MJ/kg
ansarr = np.zeros([tsize,dsize]) # specific entropy in MJ/kg/K
ancarr = np.zeros([tsize,dsize]) # sound speed cm/s
ancvarr = np.zeros([tsize,dsize]) # heat capacity J/K
ankarr = np.full((tsize,dsize), 0) # phase flag or problem

# density array, temperature array
inext = 2
andarr = allarr[inext:inext+dsize] # g/cm3
inext = inext+dsize
antarr = allarr[inext:inext+tsize] # K
inext = inext+tsize

inext = float(inext)
dsize = float(dsize)
itarr = np.arange(len(antarr))
# pressure, loop over temperture, loop over density
for i in itarr:
    anparr[i,:] = allarr[int(inext):int(inext+dsize)] # GPa
    inext = inext+dsize
# inernal energy, loop over temperture, loop over density
for i in itarr:
    anearr[i,:] = allarr[int(inext):int(inext+dsize)] # MJ/kg
    inext = inext+dsize
# Helmholtz free energy, loop over temperture, loop over density
for i in itarr:
    anaarr[i,:] = allarr[int(inext):int(inext+dsize)] # MJ/kg
    inext = inext+dsize
# specific entropy, loop over temperture, loop over density
for i in itarr:
    ansarr[i,:] = allarr[int(inext):int(inext+dsize)] # MJ/kg/K
    inext = inext+dsize
# sound speed, loop over temperture, loop over density
for i in itarr:
    ancarr[i,:] = allarr[int(inext):int(inext+dsize)] # MJ/kg/K
    inext = inext+dsize
# heat capacity, loop over temperture, loop over density
for i in itarr:
    ancvarr[i,:] = allarr[int(inext):int(inext+dsize)] # MJ/kg/K
    inext = inext+dsize
# KPA flag, loop over temperture, loop over density
for i in itarr:
    tmp =  allarr[int(inext):int(inext+dsize)]
    ankarr[i,:] = tmp.astype(int) # phase flag or problem flag
    inext = inext+dsize

dsize=int(dsize)
tsize=int(tsize)
 
neg_count = len(list(filter(lambda x: (x < 0), np.reshape(ankarr,int(dsize*tsize)))))
print("Number of bad KPA flags in EOS table: ",neg_count)

#                                TABLE          ANEOS
#     KPAQQ=STATE INDICATOR      =1, 1p    =1, 1p    (eos without melt)
#                                =2, 2p lv =2, 2p liquid/solid plus vapor
#                                          =4, 1p solid  (eos with melt)
#                                          =5, 2p melt   (eos with melt)
#                                          =6, 1p liquid (eos with melt)
#                                =-1 bad value of temperature
#                                =-2 bad value of density
#                                =-3 bad value of material number


anparrorig=np.copy(anparr)
anearrorig=np.copy(anearr)
anaarrorig=np.copy(anaarr)
ansarrorig=np.copy(ansarr)
ancarrorig =np.copy(ancarr)
ancvarrorig = np.copy(ancvarr)
ankarrorig = np.copy(ankarr)

################### REMOVE TENSION REGION ###########################
REMOVETENSIONFLAG=1  # 0- keep tension region; 1- remove tension region
if REMOVETENSIONFLAG:
    for itt in range(tsize-1,-1,-1):
        tmp = np.where(anparr[itt,:] < 0.)
        if (len(tmp[0]) > 0):
            badind = tmp[0]
            if badind[0] > 0:
                #print(itt, antarr[itt], 'tension only', anparr[itt,badind[0]-1])
                anparr[itt,badind] = np.full(len(badind),anparr[itt,badind[0]-1])
                anearr[itt,badind] = np.full(len(badind),anearr[itt,badind[0]-1])
                ansarr[itt,badind] = np.full(len(badind),ansarr[itt,badind[0]-1])
                anaarr[itt,badind] = np.full(len(badind),anaarr[itt,badind[0]-1])
                ancarr[itt,badind] = np.full(len(badind),ancarr[itt,badind[0]-1])
                ancvarr[itt,badind] = np.full(len(badind),ancvarr[itt,badind[0]-1])
                ankarr[itt,badind] = np.full(len(badind),2)

    #### WRITE NEW SESAME TABLE WITH NO TENSION REGION
    #     WRITE STANDARD (SHORT) SESAME FILE
    #     WRITE SESAME TABLE TO FILE LIMITED TO P, E, HFE
    sesfile = open("NEW-SESAME-STD-NOTENSION.TXT","w")  
    #     WRITE SESAME HEADER INFORMATION: EOS matid number, number of words in section
    #     could input matid, date, version with the grid
    # these parameters are set in the cell above that sets up the grid for ANEOS
    #MATID = 1.0        # MATID number
    #DATE = 190602.     # Date as a single 6-digit number
    #VERSION = 1.1      # ANEOS Parameters Version number
    #FMN = 70.          # Formula weight in atomic numbers for Mg2SiO4
    #FMW = 140.691      # Formula molecular weight (g/cm3) for Mg2SiO4
    # The following define the default initial state for material in the 201 table
    # For this set of ANEOS parameters, this is the solid at the melting point with the compromise bulk modulus
    # can change these values here for the notension table
    # These values are for a cold planetesimal starting condition
    RHO0REF = 3.137886      # g/cm3
    K0REF   = 0.3E12   # dynes/cm2
    T0REF   = 250.    # K
    # These variables are needed for the standard table output
    NWDS=9
    SESNTABLES=2.0
    TABLE1 = 201.0
    TABLE2 = 301.0
    #     5 entries in 201 table
    SESNWDS1=5.0
    #     Number of entries in STANDARD 301 table: 3 variables at each rho,T point
    SESNWDS2=2.+dsize+tsize+dsize*tsize*3.
    #     HEADER SECTION
    #sesfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (antarr[iit],rnew,pnew,enew,snew,upnew,usnew))
    sesfile.write(" INDEX      MATID ={:7d}    NWDS = {:8d}\n".format(int(MATID), int(NWDS)))
    sesfile.write("{:16.8e}{:16.8e}{:16.8e}{:16.8e}{:16.8e}\n".format(MATID, DATE, DATE, VERSION, SESNTABLES))
    sesfile.write("{:16.8e}{:16.8e}{:16.8e}{:16.8e}\n".format(TABLE1, TABLE2, SESNWDS1, SESNWDS2))
    # 201 SECTION
    sesfile.write(" RECORD     TYPE ={:5d}     NWDS = {:8d}\n".format(int(TABLE1),int(SESNWDS1)))
    sesfile.write("{:16.8e}{:16.8e}{:16.8e}{:16.8e}{:16.8e}\n".format(FMN, FMW, RHO0REF, K0REF, T0REF))
    sesfile.write(" RECORD     TYPE ={:5d}     NWDS = {:8d}\n".format(int(TABLE2),int(SESNWDS2)))
    sesfile.write("{:16.8e}{:16.8e}".format(dsize, tsize))
    STYLE=2
    #     density array g/cm3
    for k in range(0, int(dsize)):
        sesfile.write("{:16.8e}".format(andarr[k]))
        STYLE=STYLE+1
        if (np.mod(STYLE,5) == 0):
            sesfile.write("\n")
    #     temperature array K
    for j in range(0, int(tsize)):
        sesfile.write("{:16.8e}".format(antarr[j]))
        STYLE=STYLE+1
        if (np.mod(STYLE,5) == 0):
            sesfile.write("\n")
    #  pressure array GPa anparr[tempindex,dindex]
    for j in range(0,int(tsize)):
        for k in range(0,int(dsize)):
            sesfile.write("{:16.8e}".format(anparr[j,k]))
            STYLE=STYLE+1
            if (np.mod(STYLE,5) == 0):
                sesfile.write("\n")
    #  specific internal energy array MJ/kg anearr[tempindex,dindex]
    for j in range(0,int(tsize)):
        for k in range(0,int(dsize)):
            sesfile.write("{:16.8e}".format(anearr[j,k]))
            STYLE=STYLE+1
            if (np.mod(STYLE,5) == 0):
                sesfile.write("\n")
    # Helmholtz free energy array in MJ/kg anaarr[tempindex,dindex]
    for j in range(0,int(tsize)):
        for k in range(0,int(dsize)):
            sesfile.write("{:16.8e}".format(anaarr[j,k]))
            STYLE=STYLE+1
            if (np.mod(STYLE,5) == 0):
                sesfile.write("\n")
    # close the SESAME TABLE FILE
    sesfile.close() 
print('Done writing the SESAME 301 notension table: NEW-SESAME-STD-NOTENSION.TXT')
########## END REMOVE TENSION REGION ##################

#--------------------------------------------------------------------------
########## MAKE GADGET2 TABLE ARRAYS ###################
gadparr = np.zeros((ssize,dsize))
gadearr = np.zeros((ssize,dsize))
gadtarr = np.zeros((ssize,dsize))
gadcarr = np.zeros((ssize,dsize))

# some combinations of density and sp. entropy are not in the EOS surface
# in these cases, apply minimum values
gadpmin = 1.e-20 # GPa
gademin = 0.0 # MJ/kg
gadtmin = 1. # K
gadcmin = 100. # cm/s

for iis in range(0,ssize):
    for iid in range(0,dsize):
        # INTERPOLATION ROUTINES REQUIRE THAT THE X-ARRAY BE INCREASING
        # THIS IS NOT ALWAYS TRUE IN THE ENTROPY ARRAY
        # CHECK FOR POSITIVE VALUES AND MONOTONIC REGIONS
        ipos = np.where(ansarr[:,iid] > 0.)
        if len(ipos) > 5:
            print('iid, # pos',iid, len(ipos))
            diff = np.roll(ansarr[ipos,iid],1)-ansarr[ipos,iid]
            idown = np.where(diff < 0.)
            if len(idown) > 0:
                print('STOP! Problems interpolating gadget2 arrays!', iis,iid)
            # need to try spline interpolation for pressure interpolation. For now, linear of log P
            tmpp = np.interp(gridsarr[iis],ansarr[ipos,iid],np.log10(anparr[ipos,iid]))
            gadparr[iis,iid] = np.power(10.,tmpp[0]) 
            gadearr[iis,iid] = np.interp(gridsarr[iis],ansarr[ipos,iid],anearr[ipos,iid])
            gadtarr[iis,iid] = np.interp(gridsarr[iis],ansarr[ipos,iid],antarr)
            gadcarr[iis,iid] = np.interp(gridsarr[iis],ansarr[ipos,iid],ancarr)
        else:
            gadparr[iis,iid] = gadpmin
            gadearr[iis,iid] = gademin
            gadtarr[iis,iid] = gadtmin
            gadcarr[iis,iid] = gadcmin
            
print('Done interpolating the gadget2 table.')
#### WRITE NEW GADGET2 TABLE WITH NO TENSION REGION
sesfile = open("NEW-GADGET2-NOTENSION.TXT","w")  
sesfile.write("{:16.8e}{:16.8e}".format(dsize, tsize))
STYLE=2
#     density array g/cm3
for k in range(0, int(dsize)):
    sesfile.write("{:16.8e}".format(andarr[k]))
    STYLE=STYLE+1
    if (np.mod(STYLE,5) == 0):
        sesfile.write("\n")
#     temperature array K
for j in range(0, int(tsize)):
    sesfile.write("{:16.8e}".format(antarr[j]))
    STYLE=STYLE+1
    if (np.mod(STYLE,5) == 0):
        sesfile.write("\n")
#  pressure array GPa anparr[tempindex,dindex]
for j in range(0,int(tsize)):
    for k in range(0,int(dsize)):
        sesfile.write("{:16.8e}".format(anparr[j,k]))
        STYLE=STYLE+1
        if (np.mod(STYLE,5) == 0):
            sesfile.write("\n")
#  specific internal energy array MJ/kg anearr[tempindex,dindex]
for j in range(0,int(tsize)):
    for k in range(0,int(dsize)):
        sesfile.write("{:16.8e}".format(anearr[j,k]))
        STYLE=STYLE+1
        if (np.mod(STYLE,5) == 0):
            sesfile.write("\n")
# Helmholtz free energy array in MJ/kg anaarr[tempindex,dindex]
for j in range(0,int(tsize)):
    for k in range(0,int(dsize)):
        sesfile.write("{:16.8e}".format(anaarr[j,k]))
        STYLE=STYLE+1
        if (np.mod(STYLE,5) == 0):
            sesfile.write("\n")
# close the SESAME TABLE FILE
sesfile.close() 
print('Done writing the gadget2 table: NEW-GADGET2-NOTENSION.TXT')
########## END WRITE GADGET2 EOS TABLE ##################


#======================================================================
# Gather some experimental and theoretical data on forsterite

# Read in 1 bar data for forsterite from Gillet
Gilletfile='Gillet-Forsterite_Entropy_to_3000K.txt'
Gilletdatarr = pd.read_csv(Gilletfile,skiprows=1)

# Read in data thief'd melt curve for forsterite from Mosenfelder et al. 2007
# P GPa and T K
Mosenfelderfile='mosenfelder.txt'
Mosenfelderdatarr = pd.read_csv(Mosenfelderfile,skiprows=1)

# Davies gruneisen parameter from Z release data May 23, 2019
fileZdata='Gamma_Release_Data_20190523.txt'
#Load in Shallow Release Densities and Gammas
SR_rho=np.loadtxt(fileZdata,delimiter=',',skiprows=1,usecols=[2])
SR_rho_e=np.loadtxt(fileZdata,delimiter=',',skiprows=1,usecols=[3])
SR_gamma=np.loadtxt(fileZdata,delimiter=',',skiprows=1,usecols=[0])
SR_gamma_e=np.loadtxt(fileZdata,delimiter=',',skiprows=1,usecols=[1])

tableZgamma = pd.read_csv(fileZdata,nrows=9)
#print("Erik Davies Forsterite gamma release data")
#print(tableZgamma)

#Townsend QMD isotherms
fileQMDdata='md_results_mg2sio4_n56.dat'
QMD_r=np.loadtxt(fileQMDdata,skiprows=2,usecols=[1])*1.66050267 # g/cm3
QMD_t=np.loadtxt(fileQMDdata,skiprows=2,usecols=[2])*11604. # K
QMD_e=np.loadtxt(fileQMDdata,skiprows=2,usecols=[3])*85713. # J/kg
QMD_ee=np.loadtxt(fileQMDdata,skiprows=2,usecols=[4])*85713. # J/kg
QMD_p=np.loadtxt(fileQMDdata,skiprows=2,usecols=[5])*160.21766 # GPa
QMD_pe=np.loadtxt(fileQMDdata,skiprows=2,usecols=[6])*160.21766 # GPa

#Townsend QMD Hugoniot
fileQMDHUGdata='ForsteriteHugoniot_FINAL.txt'
QMDH_r=np.loadtxt(fileQMDHUGdata,skiprows=3,usecols=[0]) # g/cm3
QMDH_cv=np.loadtxt(fileQMDHUGdata,skiprows=3,usecols=[5]) # kJ/K/kg

#-----------------------------------------------------------
# Pull the Hugoniot from the ANEOS data cube and compare to ANEOS.OUTPUT
# find the hugoniot from stp
t0=450.
tmp = get_indexes(t0,antarr)
it0 = int(tmp[0])
p0 = 1.e-4 # 1 bar in GPa
r0=3.22
#tmp = get_indexes(r0,andarr)
#ir0 = int(tmp[0])
ir0=int(np.round(np.interp(r0,gridrarr,np.arange(len(gridrarr)))))


e0 = np.interp(p0,np.resize(anparr[it0,:],int(dsize)),np.resize(anearr[it0,:],int(dsize)))
s0 = np.interp(p0,np.resize(anparr[it0,:],int(dsize)),np.resize(ansarr[it0,:],int(dsize)))
#print(e0,p0,antarr[it0],andarr[ir0])
up0=0
us0 = np.interp(p0,np.resize(anparr[it0,:],int(dsize)),np.resize(ancarr[it0,:],int(dsize)))/1.e5 # km/s
#print('k0=',us0*us0*r0)
hugoniotfile = open("pullhugoniot.txt","w")  

# loop over temperature up the table
# pull out Ehugoniot, interpolate for zero
#print('Hugoniot')
#print('Temperature Density   Pressure   IntEnergy   Sp. Entropy')
#print('K           g/cm3      GPa        MJ/kg       MJ/K/kg ')
#print(t0,r0,p0,e0,s0)
hugoniotfile.writelines('Hugoniot \n') 
hugoniotfile.writelines('Temperature Density   Pressure   IntEnergy  SpEntropy   Part. Vel.  Shock Vel. \n') 
hugoniotfile.writelines('K ,          g/cm3   ,   GPa   ,     MJ/kg  , MJ/K/kg ,   km/s ,    km/s\n') 
hugoniotfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (t0,r0,p0,e0,s0,up0,us0))
for iit in range(it0+1,int(tsize)):
# J/kg/1.e6 -> MJ/kg
#iit=it+100
    ediff = 0.5*(anparr[iit,ir0::]+p0)*(1./r0-1./andarr[ir0::])+e0 -(anearr[iit,ir0::]) # MJ/kg
    pnew = np.interp(0.,ediff,anparr[iit,ir0::])
    rnew = np.interp(0.,ediff,andarr[ir0::])
    enew = np.interp(0.,ediff,anearr[iit,ir0::])
    snew = np.interp(0.,ediff,ansarr[iit,ir0::])
    upnew = np.sqrt((pnew-p0)*(1./r0-1./rnew))
    usnew = (1./r0)*np.sqrt((pnew-p0)/(1./r0-1./rnew))
    #print(antarr[iit],rnew,pnew,enew,upnew,usnew)
    hugoniotfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (antarr[iit],rnew,pnew,enew,snew,upnew,usnew))

hugoniotfile.close() 

hugoniotfile = open("pullhugoniot.txt","r")  
hugdatarr = pd.read_csv(hugoniotfile,skiprows=2)
hugoniotfile.close() 

hugoniotfile = open("pullhugoniot-isale.txt","r")  
hugdatarrisale = pd.read_csv(hugoniotfile,skiprows=2)
hugoniotfile.close() 
hugoniotfile = open("pullhugoniot-gadget.txt","r")  
hugdatarrgadget = pd.read_csv(hugoniotfile,skiprows=2)
hugoniotfile.close() 
hugoniotfile = open("pullhugoniot-canup.txt","r")  
hugdatarrcanup = pd.read_csv(hugoniotfile,skiprows=2)
hugoniotfile.close() 
#-----------------------------------------------------------
hugoniotfile = open("pullhugoniot-1500K.txt","r")  
hug1500datarr = pd.read_csv(hugoniotfile,skiprows=2)
hugoniotfile.close() 


#-----------------------------------------------------------
# Pull A POROUS Hugoniot from the ANEOS data cube and compare to standard Hugoniot
# find the hugoniot from stp
t0=298.
tmp = get_indexes(t0,antarr)
it0 = int(tmp[0])
p0 = 1.e-4 # 1 bar in GPa
r0=3.229
#r00 = r0*.75 # 25% porosity
r00 = r0*1.0 # 0% porosity
ir0=int(np.round(np.interp(r0,gridrarr,np.arange(len(gridrarr)))))
ir00=int(np.round(np.interp(r00,gridrarr,np.arange(len(gridrarr)))))

e0 = anearr[it0,ir0]
s0 = ansarr[it0,ir0]
up0=0
us0 = ancarr[it0,ir00]
#print(r0,r00,e0,p0,antarr[it0],andarr[ir0],andarr[ir00],ir0,ir00)

hugoniotfile = open("pullporoushugoniot.txt","w")  

# loop over temperature up the table
# pull out Ehugoniot, interpolate for zero
#print('Hugoniot')
#print('Temperature Density   Pressure   IntEnergy   Sp. Entropy')
#print('K           g/cm3      GPa        MJ/kg       MJ/K/kg ')
#print(t0,r0,p0,e0,s0)
hugoniotfile.writelines('Hugoniot \n') 
hugoniotfile.writelines('Temperature Density   Pressure   IntEnergy  SpEntropy   Part. Vel.  Shock Vel. \n') 
hugoniotfile.writelines('K ,          g/cm3   ,   GPa   ,     MJ/kg  , MJ/K/kg ,   km/s ,    km/s\n') 
hugoniotfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (t0,r00,p0,e0,s0,up0,us0))
for iit in range(it0+2,int(tsize)):
#for iit in range(it0+1,it0+100,20):
# J/kg/1.e6 -> MJ/kg
#for iit in [it0+10]:
    ediff = 0.5*(anparr[iit,ir00::]+p0)*(1./r00-1./andarr[ir00::])+e0-(anearr[iit,ir00::]) # MJ/kg
    pnew = np.interp(0.,ediff,anparr[iit,ir00::])
    rnew = np.interp(0.,ediff,andarr[ir00::])
    enew = np.interp(0.,ediff,anearr[iit,ir00::])
    snew = np.interp(0.,ediff,ansarr[iit,ir00::])
    upnew = np.sqrt((pnew-p0)*(1./r00-1./rnew))
    usnew = (1./r00)*np.sqrt((pnew-p0)/(1./r00-1./rnew))
    #print(antarr[iit],rnew,pnew,enew,upnew,usnew)
    hugoniotfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (antarr[iit],rnew,pnew,enew,snew,upnew,usnew))
    
hugoniotfile.close() 

hugoniotfile = open("pullporoushugoniot.txt","r")  
hugporousdatarr = pd.read_csv(hugoniotfile,skiprows=2)
hugoniotfile.close() 
#-----------------------------------------------------------

#-----------------------------------------------------------
# Pull A POROUS PLANETESIMAL Hugoniot from the ANEOS data cube and compare to standard Hugoniot


hugoniotfile = open("pullporous2hugoniot.txt","r")  
hugporous2datarr = pd.read_csv(hugoniotfile,skiprows=2)
hugoniotfile.close() 
#-----------------------------------------------------------


qmdhugoniotfile = open("ForsteriteHugoniot_FINAL_QMD.txt","r")  
qmdhugdatarr = pd.read_csv(qmdhugoniotfile,skiprows=1)
qmdhugoniotfile.close() 


zhugoniotfile = open("Z_Hugoniot.txt","r")  
zhugdatarr = pd.read_csv(zhugoniotfile,skiprows=369)
zhugoniotfile.close() 

# low pressure data datathiefed from Mosenfelder et al. 2007
lowhugoniotfile = open("forsterite-hugoniot.txt","r")  
lowhugdatarr = pd.read_csv(lowhugoniotfile,skiprows=1)
lowhugoniotfile.close() 

# Fiquet et al 2010 Peridotite solidus and liquidus
peridotitefile = open("Fiquet-2010-Science-Peridotite-Melting-Fig3-solidus.txt","r")  
peridotitesolidusdatarr = pd.read_csv(peridotitefile,skiprows=1)
peridotitefile.close() 
peridotitefile = open("Fiquet-2010-Science-Peridotite-Melting-Fig3-liquidus.txt","r")  
peridotiteliquidusdatarr = pd.read_csv(peridotitefile,skiprows=1)
peridotitefile.close() 

# Thomas & Asimow 2013 Forsterite Liquid shock data BAD TABULATED VALUES
#foliqhugpres = [0.,9.21,22.98,47.6,75.0,96.7,114.3]
#foliqhugdens = [2.273,3.34,3.74,4.1,4.29,4.68,4.68]
# recalculate the TA13 Hugoniot Points 
# May 2019: Confirmed with Asimow that the tabulated values are incorrect and recalculation values are correct
# He says incorrect values only in the published tables; Correct values used in the thermodynamic analysis.
foliqrho0 = 2597.
foliqup = np.asarray([1.644,0.886,4.08,2.59,3.41,4.43])
foliqus = np.asarray([5.38,4.,9.14,7.1,8.47,9.95])
foliqup = foliqup*1000.
foliqus = foliqus*1000.
foliqp = foliqrho0*foliqup*foliqus
foliqv = (1./foliqrho0)*(1.-foliqup/foliqus)
foliqrho = 1./foliqv

# Stored Forsterite ANEOS parameters for STSM SLG v1.1 liquid Hugoniot based at 2273 K and 2.661 g/cm3.
foliqhugfile = open("ANEOS.OUTPUT.foliqhug","r")  
foliqhugdat=foliqhugfile.readlines()
foliqhugfile.close()

nhc = 33
foliqhcarr = np.zeros((nhc,9),dtype=float)
for j in np.arange(nhc):
    tmp=str.replace(foliqhugdat[j+5],'D','E')
    tmp3 = tmp[0:109]
    tmp4 = list(tmp3.split())
    tmp5 = np.asarray(tmp4)
    #print('fo liq hug',j,tmp5)
    foliqhcarr[j,:] = tmp5[:]
    
# Stored Forsterite ANEOS parameters for STSM SLG v1.1 STP Hugoniot based at 298 K and 3.22 g/cm3.
fostphugfile = open("ANEOS.OUTPUT.fostphug","r")  
fostphugdat=fostphugfile.readlines()
fostphugfile.close()

nhc =33
fostphcarr = np.zeros((nhc,9),dtype=float)
for j in np.arange(nhc):
    tmp=str.replace(fostphugdat[j+5],'D','E')
    tmp3 = tmp[0:109]
    tmp4 = list(tmp3.split())
    tmp5 = np.asarray(tmp4)
    fostphcarr[j,:] = tmp5[:]
 *         ANEOS INPUT FILE
 *         EOS#      string for EOS name           .....Hugoniot initial........ long
 *                                                 T(eV)           Rho(g/cc)     flag
 ANEOS1    -1        'Forsterite STS SLGDF2.0'     THUG=0.037      RHUG=3.22     LONG

 *
 *         nelem     type      rho0      temp0(K)  press0    B0/-Cbulk Gamma0    Tdebye(K)
 *         V01       V02       V03       V04       V05       V06       V07       V08
 ANEOS2    3         4         2.9       2163.     1.e6      0.70E12   0.75       -1200.

 *         TG model  Gamma     Esep      Tmelt(K)  ..Critical Pt..     Thermal Conduction
 *         or S1     3*C24     erg/g     or -Em    C53       C54       H0        C41
 *         V09       V10       V11       V12       V13       V14       V15       V16
 ANEOS3    -1        5.5       1.83E11   2163.     0.        0.        0.        0.

 *         solid     .....Solid-solid phase transition data.....                 rhol/rhos
 *         rhomin    D1        D2        D3        D4        D5        Hfusion   or -rholiq
 *         V17       V18       V19       V20       V21       V22       V23       V24
 ANEOS4    2.5       0.0       0.0       0.0       0.0       0.0       1.0E10    0.94

 *         Cold comp. limits    ...Liquid EOS params...       ...Interpolation params...
 *         Up        L0        alpha     beta      gamma     C60       C61       C62
 *         V25       V26       V27       V28       V29       V30       V31       V32
 ANEOS5    0.        0.        0.3       0.1       0.2       0.        -0.8      0.5

 *         Ioniz.    Reactive_chemistry  ...............Molecular Clusters...............
 *         model     Eshift    Sshift    Atoms     Ebind(eV) RotDOF    Rbond     VibDOF
 *         V33       V34       V35       V36       V37       V38       V39       V40
 ANEOS6    0         0.        0.        2         4.25      2.0       1.5E-8    1

 *         Theta_vib Pcold/Expanded      Hc*3nR    QCC1      QCC6      Unused    Unused
 *         (K)       Mieflag   a_exp     adjust    rhomin    psitrans  
 *         V41       V42       V43       V44       V45       V46       V47       V48
 ANEOS7    2000.     1         1.65      1.35      1.D-30    1.D5      0.        0.

 *
 *         Elements in material (number must = nelem)
 *         Z         Atomic Fraction
 ANEOS8    8         0.571

 ANEOS9    12        0.286

 ANEOS10   14        0.143



Loaded ANEOS Model for Material: Forsterite STS SLGDF2.0
===> Check last line in EOS table:   6.00000000E+00 [6. 0. 0. 0. 0.]
Number of bad KPA flags in EOS table:  0
Done writing the SESAME 301 notension table: NEW-SESAME-STD-NOTENSION.TXT
Done interpolating the gadget2 table.
Done writing the gadget2 table: NEW-GADGET2-NOTENSION.TXT

Tillotson parameters for dunite/forsterite

Tillotson is a simple pressure-volume-internal energy equation of state model that was developed for metals (Tillotson 1962). Temperature is typically approximated by a constant heat capacity. Here, I have not implemented a temperature calculation.

There are no true phase boundaries but there is a split in the EOS between condensed and gas regions with an interpolated region.

Here are the material parameters selected for dunite by Marinova et al. Icarus 2011 (used by Hosono et al. 2019):
$\rho_0$ = Reference density at zero pressure = 3500 kg/m$^3$
$A$ = Bulk modulus $K_0$ = 131e9 Pa
$B$ = B constant = 49e9 Pa
$E_0$ = E0 contant (NOT reference state specific internal energy) = 550e6 J/kg
$a$ = a constant = 0.5 [-]
$b$ = b constant = 1.4 [-]
$\alpha$ = $\alpha$ constant = 5 [-]
$\beta$ = $\beta$ constant = 5 [-]
$E_{IV}$ = specific internal energy of incipient vaporization = 4.5e6 J/kg
$E_{CV}$ = specific internal energy of complete vaporization = 14.5e6 J/kg

The sum of constants $a$ and $b$ is the Mie-Gruneisen parameter at the reference density: $a+b = \Gamma(\rho_0)$

Here, I have coded two different implementations of Tillotson: (1) from Hosono et al. Nature Geoscience 2019 and (2) from iSALE Dellen version. There are some slight differences but the overall topology of the EOS are the same.

Because the Tillotson equations produce large negative pressure values when $\rho<\rho_0$ and $E<E_{CV}$, the EOS is implemented with a pressure minimum that varies between implementations and papers.

In [7]:
# HERE I HAVE CODED TWO DIFFERENT IMPLEMENTATIONS OF TILLOTSON
# ONE FROM HOSONO ET AL. NATURE GEOSCIENCE 2019 AND ONE FROM ISALE
#================================================================
# TILLOTSON FUNCTIONS AS IMPLEMENTED BY HOSONO
# dunite tillotson parameters used by Hosono et al. 2019 
# these olivine parameters are from Marinova et al. 2011 Icarus 
# parameters: [rho0, E0, EIV, ECV, AA, BB, a, b, alpha, beta]
# units:    [kg/m3, J/kg, J/kg, J/kg, Pa, Pa, [-]x4]
dunitetill = [3500.0, 550.0e+6, 4.500e+6, 14.50e+6, 131.00e+9,  49.00e+9, 0.5, 1.4, 5.0, 5.0]
# Basalt parameters from iSALE -- from where? Benz?
#basalttill = [2650.0, 4.87E8, 4.72E6, 18.2E6, 5.3E10, 5.3E10, 0.6, 0.6, 5., 5.]

def Till_P_co(dens,eng,tilleos):
    r0 = 0
    E0 = 1
    EIV = 2
    ECV=3
    AA=4
    BB=5
    a=6
    b=7
    alpha=8
    beta=9
    # Hosono implementation - straight up equation
    eta  = dens/tilleos[r0]
    mu   = eta - 1.0
    pco = (tilleos[a] + tilleos[b] / (eng / tilleos[E0] / eta / eta + 1.0)) * dens * eng + \
         tilleos[AA] * mu + tilleos[BB] * mu * mu

    return pco

def Till_P_ex(dens,eng,tilleos):
    import numpy as np
    r0 = 0
    E0 = 1
    EIV = 2
    ECV=3
    AA=4
    BB=5
    a=6
    b=7
    alpha=8
    beta=9
    # hosono equation
    eta  = dens/tilleos[r0]
    mu   = eta - 1.0
    pex = tilleos[a] * dens * eng + \
          (tilleos[b] * dens * eng / (eng / tilleos[E0] / eta / eta + 1.0) + \
           tilleos[AA] * mu * np.exp(- tilleos[beta] * (1.0 / eta - 1.0))) * \
                                       np.exp(- tilleos[alpha] * (1.0 / eta - 1.0) * (1.0 / eta - 1.0))
    return pex

def Till_P_Hosono(dens,eng,tilleos):
    flag=0 # flag for the region of the EOS
    r0 = 0 # index numbers for variables in the tilleos array
    E0 = 1
    EIV = 2
    ECV=3
    AA=4
    BB=5
    a=6
    b=7
    alpha=8
    beta=9

    # Hosono has 2 options
    pmin=1.e-7
    
    # option 1
    if ( (dens>=tilleos[r0]) or (eng < tilleos[EIV]) ):
        # condensed region
        flag=1
        pco = Till_P_co(dens,eng,tilleos)
        if pco < pmin:
            pout = pmin
        else:
            pout = pco
        return [pout,flag]
    else:
        if ( (dens < tilleos[r0]) and (eng > tilleos[ECV]) ):
            # expanded region
            flag=3
            pex = Till_P_ex(dens,eng,tilleos)
            if pex < pmin:
                pout = pmin
            else:
                pout = pex
            return [pout,flag]
        else:
            # interpolated region
            flag=2
            Pex = Till_P_ex(dens,eng,tilleos)
            Pco = Till_P_co(dens,eng,tilleos)
            if Pco < pmin:
                Pco = pmin
            Pint = ((eng-tilleos[EIV])*Pex+(tilleos[ECV]-eng)*Pco)/(tilleos[ECV]-tilleos[EIV])
            if Pint < pmin:
                pout = pmin
            else:
                pout = Pint
            return [pout,flag]
        
    '''    
    # option 2
    if ( (dens>=tilleos[r0]) or (eng < tilleos[EIV]) ):
        # condensed region
        flag=1
        pout = Till_P_co(dens,eng,tilleos)
        if (dens <= 0.9*tilleos[r0]):
            pout = 1.e-16
            return [pout,flag]
    else:
        if ( (dens < tilleos[r0]) and (eng > tilleos[ECV]) ):
            # expanded region
            flag=3
            pout = Till_P_ex(dens,eng,tilleos)
        else:
            # interpolated region
            flag=2
            Pex = Till_P_ex(dens,eng,tilleos)
            Pco = Till_P_co(dens,eng,tilleos)
            pout = ((eng-tilleos[EIV])*Pex+(tilleos[ECV]-eng)*Pco)/(tilleos[ECV]-tilleos[EIV])
    if (pout < pmin):
        pout = pmin
    return [pout,flag]
    '''
    # END HOSONO TILLOTSON FUNCTION

def Till_dPdrho(dens,eng,tilleos):
    drho=0.0001
    a = Till_P_Hosono(dens+drho,eng,tilleos)
    b = Till_P_Hosono(dens-drho,eng,tilleos)
    return  (a[0] - b[0])/(2.*drho)

def Till_dPdu(dens,eng,tilleos):
    ddu=0.0001
    a=Till_P_Hosono(dens,eng+ddu,tilleos) 
    b=Till_P_Hosono(dens,eng-ddu,tilleos) 
    return (a[0] - b[0])/(2.*ddu)

def Till_SoundSpeed(dens,eng,tilleos):
    if dens<= 100.:
        cs = 1.e-8 # m/s
    else:
        tmp = Till_P_Hosono(dens,eng,tilleos)
        cs = tmp[0]/(dens*dens)*Till_dPdu(dens,eng,tilleos) + Till_dPdrho(dens,eng,tilleos)
        if cs < 0.:
            cs = 0.
        cs = np.sqrt(cs + 1.e-16)
    return cs
# END HOSONO FUNCTIONS
# ------------------------------
# iSALE implementation of Tillotson
def Till_P(rin,ein,tilleos):
    # returns [pout,flag,csout]
    # output variables
    flag=0 # flag for the region of the EOS
    pout=0.
    csout=0.
    # tout = 0. # add temperature later
    #
    # iSALE implementation of Tillotson
    r0 = 0 # index numbers for variables in the tilleos array
    E0 = 1
    EIV = 2
    ECV=3
    AA=4
    BB=5
    a=6
    b=7
    alpha=8
    beta=9
    #
    # if density is zero or negative return 0 pressure
    if (rin <= 0.):
        pout  = 0.
        csout = 0.
        flag  = -1
        return [pout,flag,csout]
    #
    # define intermediate variables
    eta  = rin/tilleos[r0]
    mu   = eta - 1.0
    imu  = tilleos[r0]/rin - 1.0
    temp = tilleos[E0] * np.power(eta,2.)
    if (temp > 0.):
        erel = ein/temp
    else:
        erel = 0.
    ierel = 1./(erel + 1.)
    grun  = tilleos[a] + tilleos[b]*ierel
    gterm = tilleos[a] * rin * ein
    eterm = tilleos[b] * rin * ein * ierel
    #
    # initialize hot and cold terms to the pressure
    ph = 0.
    pc = 0.
    #
    if ( (eta < 1.) and (ein >= tilleos[EIV]) ):
        # expanded region above EIV
        flag = 3
        tmp  = tilleos[alpha]*np.power(imu,2.)
        if (tmp < 100.):
            exp_a = np.exp(-tmp)
        else:
            exp_a = 0.
        tmp = tilleos[beta]*imu
        if (tmp < 100.):
            exp_b = np.exp(-tmp)
        else:
            exp_b = 0.
        # compute "hot pressure"
        ph  = gterm + (eterm + tilleos[AA]*mu*exp_b)*exp_a  
        #
        # compute sound speed from derivatives
        dpre2   = tilleos[b]*ein*ierel*(1.+2.*(tilleos[alpha]*imu/eta + erel*ierel))*exp_a
        dpre3   = (tilleos[AA]/rin)*(1.+(mu/np.power(eta,2.))*(tilleos[beta]+2.*tilleos[alpha]*imu))*exp_a*exp_b
        dpreh   = tilleos[a]*ein+dpre2+dpre3
        dperh   = rin*(tilleos[a]+tilleos[b]*ierel*(1.-erel*ierel)*exp_a)
        c_dperh = (ph/np.power(rin,2.))*dperh
        cs2_h   = dpreh + c_dperh
        cs2     = cs2_h 
    #
    if ( (eta >= 1.) or (ein < tilleos[ECV]) ):
        # compressed region or expanded below energy of complete vaporization
        flag = 1
        if (eta >= 1.):
            b_temp = tilleos[BB] # in compression
        else:
            b_temp = tilleos[AA] # in expansion -- why does iSALE do this?
        pcold = (tilleos[AA] * mu) + (b_temp * np.power(mu,2.))
        pc    = gterm + eterm + pcold
        #if (pc < 0.):
        #    pc=1.e-10
        #
        # compute sound speed from derivatives
        dprec   = (tilleos[AA]+2.*b_temp*mu)/tilleos[r0] + ein*(grun+2.*tilleos[b]*erel*ierel*ierel)
        dperc   = rin * (grun-tilleos[b]*erel*ierel*ierel)
        c_dperc = (pc/(np.power(rin,2.)))*dperc
        cs2_c   = dprec + c_dperc
        cs2     = cs2_c
    #
    pout = pc + ph
    #
    if (ph*pc != 0.):    
        # interpolated region
        flag=2
        pout = ((ein-tilleos[EIV])*ph+(tilleos[ECV]-ein)*pc)/(tilleos[ECV]-tilleos[EIV])
        # transition sound speed
        dprem = ((ein-tilleos[EIV])*dpreh + (tilleos[ECV]-ein)*dprec) / (tilleos[ECV]-tilleos[EIV])
        dperm = ((ein-tilleos[EIV])*dperh + (tilleos[ECV]-ein)*dperc+ph-pc) / (tilleos[ECV]-tilleos[EIV])
        cs2_m = dprem+(pout/np.power(rin,2.))*dperm
        cs2   = cs2_m
    #
    # limiting after tillotson EOS
    if (pout <= 1.e-10):
        pout = 1.e-10 # pmin
        cs2  = tilleos[AA]/tilleos[r0]
    #
    if cs2>0:
        csout = np.sqrt(cs2)
    else:
        csout = np.sqrt(tilleos[AA]/tilleos[r0])
    return [pout,flag,csout]
    # END OF TILLOTSON EOS ISALE IMPLEMENTATION FUNCTION
#
#-------------------------
# using the same density grid as the ANEOS table
# Energy grid is set in the cell above that sets up the ANEOS grid
#
till2earr = tillearr # both variables are the same
# the plots below are set up to plot the till2* variables
# switch between Hosono or iSALE implementations of Tillotson below
till2parr = np.zeros((esize,dsize)) 
till2csarr = np.zeros((esize,dsize)) 
till2regionarr = np.zeros((esize,dsize)) 
#tillparr = np.zeros((esize,dsize)) #hosono
#tillcsarr = np.zeros((esize,dsize)) #hosono
#tillregionarr = np.zeros((esize,dsize)) #hosono

tillflag = 1 # 1 for Hosono; 2 for iSALE implementations of Tillotson

if tillflag == 1:
    print('Using the Hosono Tillotson implementation.')
    print('Tillotson parameters: ',dunitetill)
    for ie in range(0,esize):
        for ir in range(0,dsize):
            flag=0
            eng = till2earr[ie]*1.e6 # J/kg
            dens = andarr[ir]*1000. # kg/m3
            tmp = Till_P_Hosono(dens,eng,dunitetill) # returns [P Pa, flag]
            till2parr[ie,ir] = tmp[0]/1.e9 # Pa to GPa
            till2regionarr[ie,ir] = tmp[1] # cold, hot, interpolated regions
            till2csarr[ie,ir] = Till_SoundSpeed(dens,eng,dunitetill) # should return m/s but it's not

if tillflag == 2:
    print('Using the iSALE Dellen Tillotson implementation.')
    print('Tillotson parameters: ',dunitetill)
    for ie in range(0,esize):
        for ir in range(0,dsize):
            flag=0
            eng = till2earr[ie]*1.e6 # J/kg
            dens = andarr[ir]*1000. # kg/m3
            tmp = Till_P(dens,eng,dunitetill) # returns [P Pa, flag]
            till2parr[ie,ir] = tmp[0]/1.e9 # Pa to GPa
            till2regionarr[ie,ir] = tmp[1] # cold, hot, interpolated regions flag
            till2csarr[ie,ir] = tmp[2] # sound speed iSALE
                                   
#-----------------------------------------------------------
# Pull the Hugoniot from the Tillotson data cube and compare to ANEOS
r0 = dunitetill[0]/1.e3 # g/cm3 3.5
ir0=int(np.round(np.interp(r0,andarr,np.arange(dsize))))
p0=till2parr[0,ir0] # not perfectly zero because
e0 = till2earr[0]   # e0=0 for P0=0 in Tillotson formulation
#p0  = 0. # Tillotson EOS has P=0 and rho=rho0 at E=0
#e0  = 0. 
up0 = 0.
us0 = np.sqrt(dunitetill[4]/dunitetill[0])/1.e3 # km/s
s0  = 0.
t0  = 0.

#print(andarr[ir0],r0)

hugoniotfile = open("pulltillotsonhugoniot.txt","w")  
#print(t0,r0,p0,e0,s0,it0,ir0,antarr[it0],andarr[ir0])
hugoniotfile.writelines('Hugoniot \n') 
hugoniotfile.writelines('Temperature Density   Pressure   IntEnergy  SpEntropy   Part. Vel.  Shock Vel. \n') 
hugoniotfile.writelines('K ,          g/cm3   ,   GPa   ,     MJ/kg  , MJ/K/kg ,   km/s ,    km/s\n') 
hugoniotfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (t0,r0,p0,e0,s0,up0,us0))
for iir in range(ir0+1,dsize):
    ediff = 0.5*(till2parr[:,iir]+p0)*(1./r0-1./andarr[iir])+e0 -(till2earr) # MJ/kg
    pnew = np.interp(0.,np.flipud(ediff),np.flipud(till2parr[:,iir]))
    rnew = andarr[iir]
    enew = np.interp(0.,np.flipud(ediff),np.flipud(till2earr))
    snew = 0.0
    tnew = 0.0
    upnew = np.sqrt((pnew-p0)*(1./r0-1./rnew))
    usnew = (1./r0)*np.sqrt((pnew-p0)/(1./r0-1./rnew))
    hugoniotfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (tnew,rnew,pnew,enew,snew,upnew,usnew))

hugoniotfile.close() 

hugoniotfile = open("pulltillotsonhugoniot.txt","r")  
hugtilldatarr = pd.read_csv(hugoniotfile,skiprows=2)
hugoniotfile.close() 
                                   
print('Done computing Tillotson EOS grid.')                              
                        
Using the Hosono Tillotson implementation.
Tillotson parameters:  [3500.0, 550000000.0, 4500000.0, 14500000.0, 131000000000.0, 49000000000.0, 0.5, 1.4, 5.0, 5.0]
Done computing Tillotson EOS grid.

Hugoniot results

In general, the P-V-E Hugoniots are adequate, but the temperatures are too high in the liquid and the entropies are too low. The discrepancy arises because the ANEOS model has a limiting 3nR value for the specific heat capacity; the true heat capacities in the melt are larger. Here, the goal is to provide an adequate fit to modest shock pressures (<~300 GPa), covering the range for many impact problems.

The following plots compare the ANEOS model Hugoniot with laboratory data. Shock Hugoniot data points from gas gun experiments are summarized in Figure 1 of Mosenfelder et al. 2007. Those data are shown with the green plus symbol below. High pressure Hugoniot points obtained by the Z machine are shown by the fitted green curve from Root et al. 2018.

Entropy on the Hugoniot derived by Davies et al., in prep., using the Z Hugoniot, Z-derived Gruneisen parameters, and thermodynamic integration.

Orange points are corrected data points for the liquid 2273 K forsterite Hugoniot from Thomas and Asimow 2013. The orange line is the stored liquid forsterite Hugoniot based at 2273 K and 2.661 g/cm$3$. Regenerate the ANEOS.OUTPUT.foliqhug file if parameters are changed.

Red points are the ANEOS Hugoniot solution. Blue points are linear interpolations of the gridded EOS table (which needs improvement for log regions in the table).

Note that the QMD results (Root et al. 2018) have a 4.27 GPa initial pressure. The ANEOS Hugoniot based at 300 K and 3.22 g/cc has a 3.23 GPa initial pressure. For the specific energy plot, the initial energy state has been subtracted. For the requested ANEOS Hugoniot in the input file (red curve), the 300 K, 3.22 g/cc internal energy has been subtracted.

Start test Hugoniot at entropy of 0.667 kJ/K/kg to match room temperature conditions.

In [8]:
# Display the initial conditions for the Hugoniot in ANEOS.OUTPUT    
print('\nRequested ANEOS Hugoniot initial state from (THUG,RHUG) (red curves in plots below):')
print('Initial Pressure (GPa):',hcarr[0,2])
print('Initial Temperature (K):',hcarr[0,1])
print('Initial Sp. Entropy (kJ/K/kg):',hcarr[0,5]/1.e3)
print('Initial Sp. Internal Energy (kJ/kg):',hcarr[0,4]/1.e3)
print('Initial Density (g/cm3):',hcarr[0,0]/1.e3)
#
print('\nStored liquid forsterite ANEOS Hugoniot initial state (orange curve):')
print('Initial Pressure (GPa): 1.0686e-08')
print('Initial Temperature (K): 2272.4')
print('Initial Sp. Entropy (kJ/K/kg): 3.545')
print('Initial Sp. Internal Energy (kJ/kg): 3467.1')
print('Initial Density (g/cm3): 2.661')
print('If you change the ANEOS.INPUT parameters for forsterite, regenerate the liquid Hugoniot in file ANEOS.OUTPUT.foliqhug')
#
#======================LOTS OF PLOTS============================
# plot the Hugoniots for comparison
sfont = 15
fig, axes = plt.subplots(nrows=3, ncols=2, figsize=(14,16))
plt.subplots_adjust(wspace=0.5)

# make the line colors and such consistent across all the plots
style1 = ['-','blue',3,'Tabulated STP Hugoniot'] # eos table interpolated STP Hugoniot
style2 = ['--','blue',3,'Tabulated Porous Hugoniot'] # eos table interpolated porous Hugoniot
style3 = ['-','red',3,'ANEOS Hugoniot'] # ANEOS Hugoniot returned from ANHUG in ANEOS.OUTPUT
style4 = ['-','orange',3,'ANEOS Liquid Hugoniot'] # ANEOS Hugoniot returned from ANHUG in ANEOS.OUTPUT for liquid initial conditions, stored as a file

#-------------
ai=0
aj=0
axes[ai,aj].plot(hugdatarr.iloc[:,1].values,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(hugporousdatarr.iloc[:,1].values,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3])
axes[ai,aj].plot(qmdhugdatarr.iloc[:,0].values,qmdhugdatarr.iloc[:,2].values,'^',color='green',label='QMD points (Root et al. 2018)')
axes[ai,aj].plot(zhugdatarr.iloc[:,3].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',label='Z fit (Root et al. 2018)')
axes[ai,aj].plot(lowhugdatarr.iloc[:,0].values,lowhugdatarr.iloc[:,1].values,'+',color='green',label='Gas gun data (Mosenfelder et al. 2007)')

uptmp = hugdatarr.iloc[:,5].values #up in km/s
ustmp = 6.89+1.22*uptmp-1.50*uptmp*np.exp(-0.4*uptmp)
ptmp = 3220*uptmp*ustmp/1.e3 # GPa
vtmp = (1./3220)*(1.-uptmp/ustmp)
axes[ai,aj].plot(1/vtmp/1.e3,ptmp,'--',color='darkgreen',label='extrapolated Z fit')


axes[ai,aj].set_ylim(0,5000)
axes[ai,aj].set_xlim(1.,10.)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)

#-------------
ai=0
aj=1
#axes[ai,aj].plot([],[],' ',label='ANEOS Hugoniots')

axes[ai,aj].plot(hugdatarr.iloc[:,2].values,hugdatarr.iloc[:,0].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(hugporousdatarr.iloc[:,2].values,hugporousdatarr.iloc[:,0].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
#axes[ai,aj].plot(hugporous2datarr.iloc[:,2].values,hugporous2datarr.iloc[:,0].values,style2[0],color='red',markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hcarr[:,2],hcarr[:,1],style3[0],color=style3[1],markersize=style3[2],label=style3[3])

axes[ai,aj].plot(qmdhugdatarr.iloc[:,2].values,qmdhugdatarr.iloc[:,3].values,'^',color='green',label='QMD points (Root et al. 2018)')
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,1].values,color='green',label='Z fit (Root et al. 2018)')
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,1].values-zhugdatarr.iloc[:,5].values,color='green',linestyle=':')
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,1].values+zhugdatarr.iloc[:,5].values,color='green',linestyle=':')



axes[ai,aj].set_xlim(0,1000)
axes[ai,aj].set_ylim(0,50000)

axes[ai,aj].set_ylabel('Temperature (K)',size=sfont)
axes[ai,aj].set_xlabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)


#-------------
ai=1
aj=0
axes[ai,aj].plot(hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hcarr[:,5]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3])

axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',label='Entropy analysis (Davies et al. in prep.)')

axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3-zhugdatarr.iloc[:,6].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',linestyle=':')
axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3+zhugdatarr.iloc[:,6].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',linestyle=':')


axes[ai,aj].set_xlim(0,7.5)
axes[ai,aj].set_ylim(0,1000)



#axes[ai,aj].set_ylim(0,1000)
#axes[ai,aj].set_xlim(2.,8.)

axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)


#-------------
ai=1
aj=1
Eshift = hugdatarr.iloc[0,3] # MJ/kg
axes[ai,aj].plot((hugdatarr.iloc[:,3].values-Eshift)*1.e3,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot((hugporousdatarr.iloc[:,3].values-Eshift)*1.e3,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
axes[ai,aj].plot((hcarr[:,4]/1.e6-Eshift)*1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3])

# need to calculate energy on the Z Hugoniot
#axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',label='Z fit (Root et al. 2018)')
axes[ai,aj].plot((qmdhugdatarr.iloc[:,1].values-qmdhugdatarr.iloc[:,1].values[0])*1000.,qmdhugdatarr.iloc[:,2].values,'^',color='green',label='QMD (Root et al. 2018)')

axes[ai,aj].set_xlim(0,1.E5)
axes[ai,aj].set_ylim(0,1000)

axes[ai,aj].set_xlabel('Specific Energy Relative to initial state (kJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)

#-----
ai=2
aj=0

axes[ai,aj].plot(hugdatarr.iloc[:,1].values,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(hugporousdatarr.iloc[:,1].values,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3])
axes[ai,aj].plot(foliqhcarr[:,0]/1.e3,foliqhcarr[:,2],style4[0],color=style4[1],markersize=style4[2],label=style4[3])

axes[ai,aj].plot(foliqrho0/1.e3,0,'o',color='orange')
axes[ai,aj].plot(foliqrho/1.e3,foliqp/1.e9,'o',color='orange',label='TA13 Fo Liquid\nHugoniot corrected')
axes[ai,aj].plot(lowhugdatarr.iloc[:,0].values,lowhugdatarr.iloc[:,1].values,'+',color='green',label='Gas gun points\n(Mosenfelder et al. 2007)')

axes[ai,aj].set_xlim(2.,6.)
axes[ai,aj].set_ylim(0,200)

axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)

#-----
ai=2
aj=1

axes[ai,aj].plot(hugdatarr.iloc[:,1].values,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(hugporousdatarr.iloc[:,1].values,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3])
#axes[ai,aj].plot(foliqhcarr[:,0]/1.e3,foliqhcarr[:,2],style4[0],color=style4[1],markersize=style4[2],label=style4[3])

#axes[ai,aj].plot(foliqrho0/1.e3,0,'o',color='orange')
#axes[ai,aj].plot(foliqrho/1.e3,foliqp/1.e9,'o',color='orange',label='TA13 Fo Liquid\nHugoniot corrected')
#axes[ai,aj].plot(lowhugdatarr.iloc[:,0].values,lowhugdatarr.iloc[:,1].values,'+',color='green',label='Gas gun points\n(Mosenfelder et al. 2007)')

axes[ai,aj].plot(zhugdatarr.iloc[:,3].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',label='Z fit (Root et al. 2018)')

axes[ai,aj].set_xlim(5.,7.5)
axes[ai,aj].set_ylim(180,800)

axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)
Requested ANEOS Hugoniot initial state from (THUG,RHUG) (red curves in plots below):
Initial Pressure (GPa): 4.3093
Initial Temperature (K): 429.41
Initial Sp. Entropy (kJ/K/kg): 0.65088
Initial Sp. Internal Energy (kJ/kg): 214.47
Initial Density (g/cm3): 3.22

Stored liquid forsterite ANEOS Hugoniot initial state (orange curve):
Initial Pressure (GPa): 1.0686e-08
Initial Temperature (K): 2272.4
Initial Sp. Entropy (kJ/K/kg): 3.545
Initial Sp. Internal Energy (kJ/kg): 3467.1
Initial Density (g/cm3): 2.661
If you change the ANEOS.INPUT parameters for forsterite, regenerate the liquid Hugoniot in file ANEOS.OUTPUT.foliqhug
Out[8]:
<matplotlib.legend.Legend at 0x108851be0>
In [9]:
#print(meltcurve)
# ANEOS model points of reference
antcp = vcarr[0,0] # temperature of CP
anscp = vcarr[0,7]/1.e3 # kJ/K/kg sp. entropy at CP
tmp=vcarr.shape
i1bar = get_indexes(1.e-4,np.resize(vcarr[:,3],tmp[0]))
if meltcurve:
    ansimtp = float(mcarr[3,8]/1.e3)
    anscmtp = float(mcarr[3,7]/1.e3)
    anttp = float(mcarr[3,0])
    ittp = get_indexes(anttp,np.resize(vcarr[:,0],tmp[0]))
else:
    anttp = 2163.
    ansimtp = np.interp(anttp,vcarr[:,0],vcarr[:,7]/1.e3)
    anscmtp = np.interp(anttp,vcarr[:,0],vcarr[:,8]/1.e3)
    ittp=[int(round(np.interp(anttp,vcarr[:,0],np.arange(vcarr.shape[0]))))]
ansiv = float(vcarr[i1bar[0],7]/1.e3)
anscv = float(vcarr[i1bar[0],8]/1.e3)


#print(ansiv,anscv)
In [10]:
# colors for different data
colid = [0,.2,.2,.65,.80,.95]
labid = ['New ANEOS Hugoniot','Z fit Hugoniot','Gas gun Hugoniot','iSALE Hugoniot','GADGET Hugoniot','SPH-CTH Hugoniot','Tillotson Hugoniot']
labid2 = ['New ANEOS 1-bar','Z fit','Gas gun data','iSALE 1-bar','GADGET 1-bar','SPH-CTH 1-bar','Tillotson 1-bar']
linid = ['-','-','+','-','-','-']
thiid = [3,5,2,2,2,2]
msize = 3
labsize=18

#======================LOTS OF PLOTS============================
# plot the Hugoniots for comparison
sfont = 15
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(14,10))
plt.subplots_adjust(wspace=0.25)

# make the line colors and such consistent across all the plots
style1 = ['-','blue',3,'Tabulated STP Hugoniot'] # eos table interpolated STP Hugoniot
style2 = ['--','blue',3,'Tabulated Porous Hugoniot'] # eos table interpolated porous Hugoniot
style3 = ['-','red',3,'ANEOS Hugoniot'] # ANEOS Hugoniot returned from ANHUG in ANEOS.OUTPUT
style4 = ['-','orange',3,'ANEOS Liquid Hugoniot'] # ANEOS Hugoniot returned from ANHUG in ANEOS.OUTPUT for liquid initial conditions, stored as a file

#-------------
ai=0
aj=0

col=local_cmaps.parula(colid[3])

axes[ai,aj].plot(hugtilldatarr.iloc[:,1].values,hugtilldatarr.iloc[:,2].values,'--',color='gray',label='Tillotson Hugoniot')

col=local_cmaps.parula(colid[3])
axes[ai,aj].plot(hugdatarrisale.iloc[:,1].values,hugdatarrisale.iloc[:,2].values,linid[3],color=col,markersize=msize,label=labid[3],linewidth=thiid[3])
col=local_cmaps.parula(colid[4])
axes[ai,aj].plot(hugdatarrgadget.iloc[:,1].values,hugdatarrgadget.iloc[:,2].values,linid[4],color=col,markersize=msize,label=labid[4],linewidth=thiid[4])
col=local_cmaps.parula(colid[5])
axes[ai,aj].plot(hugdatarrcanup.iloc[:,1].values,hugdatarrcanup.iloc[:,2].values,linid[5],color=col,markersize=msize,label=labid[5],linewidth=thiid[5])

# plot data on top
col=local_cmaps.parula(colid[1])
axes[ai,aj].plot(zhugdatarr.iloc[:,3].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color=col,label=labid[1],linewidth=thiid[1])
col=local_cmaps.parula(colid[2])
axes[ai,aj].plot(lowhugdatarr.iloc[:,0].values,lowhugdatarr.iloc[:,1].values,'+',color=col,label=labid[2])

#new
axes[ai,aj].plot(hugdatarr.iloc[:,1].values,hugdatarr.iloc[:,2].values,style1[0],color='black',markersize=style1[2],label=labid[0],linewidth=thiid[0])


uptmp = hugdatarr.iloc[:,5].values #up in km/s
ustmp = 6.89+1.22*uptmp-1.50*uptmp*np.exp(-0.4*uptmp)
ptmp = 3220*uptmp*ustmp/1.e3 # GPa
vtmp = (1./3220)*(1.-uptmp/ustmp)
#axes[ai,aj].plot(1/vtmp/1.e3,ptmp,'--',color='darkgreen',label='extrapolated Z fit')


axes[ai,aj].set_ylim(0,1000)
axes[ai,aj].set_xlim(3.,8.)
axes[ai,aj].text(7.5, 100, 'A', fontsize=labsize)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)

#-------------
ai=0
aj=1

col=local_cmaps.parula(colid[3])
axes[ai,aj].plot(hugdatarrisale.iloc[:,2].values,hugdatarrisale.iloc[:,0].values/1.e3,linid[3],color=col,markersize=msize,label=labid[3],linewidth=thiid[3])
col=local_cmaps.parula(colid[4])
axes[ai,aj].plot(hugdatarrgadget.iloc[:,2].values,hugdatarrgadget.iloc[:,0].values/1.e3,linid[4],color=col,markersize=msize,label=labid[4],linewidth=thiid[4])
col=local_cmaps.parula(colid[5])
axes[ai,aj].plot(hugdatarrcanup.iloc[:,2].values,hugdatarrcanup.iloc[:,0].values/1.e3,linid[5],color=col,markersize=msize,label=labid[5],linewidth=thiid[5])

# plot data on top
col=local_cmaps.parula(colid[1])
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,1].values/1.e3,color=col,label='Z+Omega fit Hugoniot',linewidth=thiid[1])
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,(zhugdatarr.iloc[:,1].values-zhugdatarr.iloc[:,5].values)/1.e3,color=col,linestyle=':',linewidth=thiid[1])
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,(zhugdatarr.iloc[:,1].values+zhugdatarr.iloc[:,5].values)/1.e3,color=col,linestyle=':',linewidth=thiid[1])

#new
axes[ai,aj].plot(hugdatarr.iloc[:,2].values,hugdatarr.iloc[:,0].values/1.e3,style1[0],color='black',markersize=style1[2],label=labid[0],linewidth=thiid[0])

##axes[ai,aj].plot(hugdatarr.iloc[:,2].values,hugdatarr.iloc[:,0].values/1.e3,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(qmdhugdatarr.iloc[:,2].values,qmdhugdatarr.iloc[:,3].values/1.e3,'^',color='green',label='QMD points (Root et al. 2018)')
#axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,1].values/1.e3,color='green',label='Z fit (Root et al. 2018)')



axes[ai,aj].set_xlim(200,1000)
axes[ai,aj].set_ylim(4,40)
axes[ai,aj].text(920, 7.5, 'B', fontsize=labsize)

axes[ai,aj].set_ylabel('Temperature (1000 K)',size=sfont)
axes[ai,aj].set_xlabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)


#-------------
ai=1
aj=0




col=local_cmaps.parula(colid[3])
axes[ai,aj].plot(hugdatarrisale.iloc[:,2].values,hugdatarrisale.iloc[:,4].values*1.e3,linid[3],color=col,markersize=msize,label=labid[3],linewidth=thiid[3])
col=local_cmaps.parula(colid[4])
axes[ai,aj].plot(hugdatarrgadget.iloc[:,2].values,hugdatarrgadget.iloc[:,4].values*1.e3,linid[4],color=col,markersize=msize,label=labid[4],linewidth=thiid[4])
col=local_cmaps.parula(colid[5])
axes[ai,aj].plot(hugdatarrcanup.iloc[:,2].values,hugdatarrcanup.iloc[:,4].values*1.e3,linid[5],color=col,markersize=msize,label=labid[5],linewidth=thiid[5])

# plot data on top
col=local_cmaps.parula(colid[1])
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,2].values/1.e3,color=col,label='Calculated Hugoniot',linewidth=thiid[1])
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,(zhugdatarr.iloc[:,2].values-zhugdatarr.iloc[:,6].values)/1.e3,color=col,linestyle=':',linewidth=thiid[1])
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,(zhugdatarr.iloc[:,2].values+zhugdatarr.iloc[:,6].values)/1.e3,color=col,linestyle=':',linewidth=thiid[1])

#new
axes[ai,aj].plot(hugdatarr.iloc[:,2].values,hugdatarr.iloc[:,4].values*1.e3,style1[0],color='black',markersize=style1[2],label=labid[0],linewidth=thiid[0])


#axes[ai,aj].plot(hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
#axes[ai,aj].plot(hcarr[:,5]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3])

#axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',label='Entropy analysis (Davies et al. in prep.)')

#axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3-zhugdatarr.iloc[:,6].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',linestyle=':')
#axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3+zhugdatarr.iloc[:,6].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',linestyle=':')


axes[ai,aj].set_ylim(2,7.5)
axes[ai,aj].set_xlim(100,1000)
axes[ai,aj].text(900, 2.5, 'C', fontsize=labsize)


axes[ai,aj].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_xlabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].legend(fontsize=sfont-5)



#-----
ai=1
aj=1
axes[ai,aj].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_xlabel('Temperature (K)',size=sfont)
#axes[ai,aj].set_title("1-bar isobar",size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


s1barrisale= np.loadtxt('s1barr-isale.txt')  
col=local_cmaps.parula(colid[3])
#axes[ai,aj].plot(antarr,s1barrisale,linid[3],color=col,markersize=msize,label=labid2[3],linewidth=thiid[3])
tmp = np.where(s1barrisale <= ansiv)
tmp2 = np.where(s1barrisale[tmp] >= anscmtp-.2)
axes[ai,aj].plot(antarr[tmp2],s1barrisale[tmp2],linid[3],color=col,markersize=msize,linewidth=thiid[3]+2,label=labid2[3])
tmp = np.where(s1barrisale >= anscv-2)
axes[ai,aj].plot(antarr[tmp],s1barrisale[tmp],linid[3],color=col,markersize=msize,linewidth=thiid[3]+2)
tmp = np.where(s1barrisale <= ansimtp)
axes[ai,aj].plot(antarr[tmp],s1barrisale[tmp],linid[3],color=col,markersize=msize,linewidth=thiid[3]+2)


s1barrgadget = np.loadtxt('s1barr-gadget.txt')  
col=local_cmaps.parula(colid[4])
#axes[ai,aj].plot(antarr,s1barrgadget,linid[4],color=col,markersize=msize,label=labid2[4],linewidth=thiid[4])
tmp = np.where(s1barrgadget <= ansiv)
axes[ai,aj].plot(antarr[tmp],s1barrgadget[tmp],linid[4],color=col,markersize=msize,linewidth=thiid[4],label=labid2[4])
tmp = np.where(s1barrgadget >= anscv-2)
axes[ai,aj].plot(antarr[tmp],s1barrgadget[tmp],linid[4],color=col,markersize=msize,linewidth=thiid[4])

s1barrcanup = np.loadtxt('s1barr-canup.txt')  
col=local_cmaps.parula(colid[5])
#axes[ai,aj].plot(antarr,s1barrcanup,linid[5],color=col,markersize=msize,label=labid2[5],linewidth=thiid[5])
tmp = np.where(s1barrcanup <= anscv-4)
axes[ai,aj].plot(antarr[tmp],s1barrcanup[tmp],linid[5],color=col,markersize=msize,linewidth=thiid[5],label=labid2[5])
tmp = np.where(s1barrcanup >= anscv-4)
axes[ai,aj].plot(antarr[tmp],s1barrcanup[tmp],linid[5],color=col,markersize=msize,linewidth=thiid[5])

col=local_cmaps.parula(.1)
axes[ai,aj].plot(Gilletdatarr.iloc[:,0].values,Gilletdatarr.iloc[:,1].values/1.e3,linestyle='-',color=col,linewidth=6,label='Solid 1-bar')
col=local_cmaps.parula(.3)
#axes[ai,aj].plot(Gilletdatarr.iloc[:,2].values,Gilletdatarr.iloc[:,3].values/1.e3,linestyle='-',color=col,linewidth=6,label='Liquid 1-bar')
sintliq = np.zeros(3300-2163)
sintliq[0]=anscmtp*1.e3
tintliq = np.arange(3300-2163)+2163
#print(tintliq)
#for tt in range(2164,3300,1):
it=0
for tt in tintliq:
    sintliq[it] = anscmtp*1.e3 + 1926.18*np.log(tt/2163)
    #axes[ai,aj].plot(tt,sint/1.e3,'+',color='blue')
    it=it+1
axes[ai,aj].plot(tintliq,sintliq/1.e3,linestyle='-',color=col,linewidth=6,label='Liquid 1-bar')


axes[ai,aj].set_ylim(0,11)
axes[ai,aj].set_xlim(0,5000)
axes[ai,aj].text(4200, 1, 'D', fontsize=labsize)

it=0
s1barr = np.zeros(len(antarr))
sint = np.interp(1.e-4,np.resize(anparr[it,:],dsize),np.resize(ansarr[it,:],dsize))
    #print(it,sint)
#axes[ai,aj].plot(antarr[0],sint*1.e3,'+',color='blue',label="ANEOS 1 bar")
for tt in antarr:
    sint = np.interp(1.e-4,np.resize(anparr[it,:],dsize),np.resize(ansarr[it,:],dsize))
    s1barr[it] = sint*1.e3
    #print(it,sint)
#    axes[ai,aj].plot(tt,sint*1.e3,'+',color='blue')
    #print(tt,sint*1.e3)
    it=it+1

#tmp = np.where(antarr < 2163.)
#axes[ai,aj].plot(antarr,s1barr,'+',color='black',markersize=style1[2],label=labid2[0],linewidth=thiid[0])
tmp = np.where(s1barr <= ansiv)
tmp2 = np.where(s1barr[tmp] >= anscmtp)
axes[ai,aj].plot(antarr[tmp2],s1barr[tmp2],'-',color='black',markersize=style1[2],linewidth=thiid[0],label=labid2[0])
tmp = np.where(s1barr >= anscv)
axes[ai,aj].plot(antarr[tmp],s1barr[tmp],'-',color='black',markersize=style1[2],linewidth=thiid[0])
tmp = np.where(s1barr <= ansimtp)
tmp2 = np.zeros(len(tmp[0])+1)
tmp2[0:44] = s1barr[tmp[0]]
tmp2[44]=ansimtp
tmp1 = np.zeros(len(tmp[0])+1)
tmp1[0:44] = antarr[tmp[0]]
tmp1[44]=2163.
axes[ai,aj].plot(tmp1,tmp2,'-',color='black',markersize=style1[2],linewidth=thiid[0])



axes[ai,aj].legend(fontsize=sfont-5)

#fig.savefig('comphugs.pdf')
plt.tight_layout(pad=0.4,w_pad=0.5,h_pad=1.0)
plt.savefig('comphugs.pdf', format='pdf', dpi=1000,transparent=True)
/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:181: RuntimeWarning: invalid value encountered in less_equal
/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:183: RuntimeWarning: invalid value encountered in greater_equal

Phase boundary results

Black lines are the ANEOS phase boundaries. Red curve is the ANEOS Hugoniot. Blue curve is the interpolated Hugoniot from the gridded eos table.

Comparison critical points from experimentally constrained quartz critical point (Kraus et al. 2012), ab initio enstatite critical point (Xiao & Stixrude 2018), ab initio pyrolite critical point (Caracas in prep.).

Orange diamonds are the 1-bar boiling point; orange squares are the 1-bar melting point.

In [11]:
print('ANEOS Calculated Critical point:')
print('Temperature (K): ',vcarr[0,0])
print('Density (g/cm$^3$): ',vcarr[0,1]/1.e3)
print('Pressure (GPa): ', vcarr[0,3])
print('Sp. Energy (MJ/kg): ', vcarr[0,5]/1.e6)
print('Sp. Entropy (kJ/kg): ', vcarr[0,7]/1.e3)
antcp = vcarr[0,0]
anscp = vcarr[0,7]/1.e3 # kJ/kg

# ANEOS model points of reference
antcp = vcarr[0,0] # temperature of CP
anscp = vcarr[0,7]/1.e3 # kJ/K/kg sp. entropy at CP
tmp=vcarr.shape
i1bar = get_indexes(1.e-4,np.resize(vcarr[:,3],tmp[0]))

if meltcurve:
    ansimtp = float(mcarr[3,8]/1.e3)
    anscmtp = float(mcarr[3,7]/1.e3)
    anttp = float(mcarr[3,0])
    ittp = get_indexes(anttp,np.resize(vcarr[:,0],tmp[0]))
else:
    anttp = 2163.
    ansimtp = np.interp(anttp,vcarr[:,0],vcarr[:,7]/1.e3)
    anscmtp = np.interp(anttp,vcarr[:,0],vcarr[:,8]/1.e3)
    ittp=[int(round(np.interp(anttp,vcarr[:,0],np.arange(vcarr.shape[0]))))]

anscvtp = float(vcarr[ittp[0],8]/1.e3)
print('MELT at the triple point T, SIM, SCM, SCV: ',anttp,ansimtp,anscmtp,anscvtp)
ansiv = float(vcarr[i1bar[0],7]/1.e3)
anscv = float(vcarr[i1bar[0],8]/1.e3)
antiv = float(vcarr[i1bar[0],0])
anriv = float(vcarr[i1bar[0],1])
print('\nANEOS Calculated 1-bar boiling point:')
print('Sp. Entropy for incipient vaporization IV (kJ/kg): ', ansiv, '. check 1:', vcarr[i1bar[0],3]*1.e4)
print('Sp. Entropy for complete vaporization CV (kJ/kg): ', anscv)
print('Temperature at boiling (K): ', round(antiv))
print('Density at boiling (g/cm3): ', round(anriv)/1.e3)

print('\nANEOS 1-bar melting point is defined by the input parameters. See plots below.')
print('Triple point estimate:')
print('Sp. Entropy for incipient melting IM at TP (kJ/kg): ', ansimtp)
print('Sp. Entropy for complete melting CM at TP (kJ/kg): ', anscmtp)

tmp = hcarr.shape
piv = np.interp(ansiv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
pcp = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
tiv = np.interp(ansiv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))
tcp = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))
eiv = np.interp(ansiv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,4],tmp[0]))
ecp = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,4],tmp[0]))
upiv = np.interp(ansiv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,7],tmp[0]))
upimtp = np.interp(ansimtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,7],tmp[0]))
upcmtp = np.interp(anscmtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,7],tmp[0]))
pim = np.interp(ansimtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
pcm = np.interp(anscmtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
tim = np.interp(ansimtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))
tcm = np.interp(anscmtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))

#upiv = np.interp(ansiv,np.resize(hugdatarr.iloc[:,5].values,tmp[0])*1.e3,np.resize(hugdatarr.iloc[:,6].values,tmp[0]))
#upimtp = np.interp(ansimtp,np.resize(hugdatarr.iloc[:,5].values,tmp[0])*1.e3,np.resize(hugdatarr.iloc[:,6].values,tmp[0]))
#print(ansimtp,np.resize(hugdatarr.iloc[:,4].values,tmp[0])*1.e3,np.resize(hugdatarr.iloc[:,5].values,tmp[0]))
#print(hcarr.shape)

print('\nANEOS model conditions for shock-induced vaporization:')
print('Impact velocity for IM at TP (km/s):', upimtp*2.)
print('Impact velocity for CM at TP (km/s):', upcmtp*2.)
print('Impact velocity for IV at 1 bar (km/s):', upiv*2.)
print('Shock pressure (GPa) to model IV sp. entropy (kJ/K/kg): ',round(piv))
print('Shock pressure (GPa) to model CP sp. entropy (kJ/K/kg): ',round(pcp))
print("Shock temperature (K) at model SIV:",round(tiv))
print("Shock temperature (K) at model SCP:",round(tcp))
print('Shock pressure, Temperature (GPa, K) to model IM sp. entropy (kJ/K/kg): ',round(pim), round(tim))
print('Shock pressure, Temperature (GPa, K) to model CM sp. entropy (kJ/K/kg): ',round(pcm), round(tcm))


#axes[ai,aj].plot(hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])

#indt=0
#indd=1
#indp=2
#inde=3
#inds=4
#indup = 5
#indus = 6
tmp = len(hugdatarr.iloc[:,0].values)
pivpp = np.interp(ansiv,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
pcppp = np.interp(anscp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
tivpp = np.interp(ansiv,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,0].values)
tcppp = np.interp(anscp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,0].values)
eivpp = np.interp(ansiv,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,3].values)
ecppp = np.interp(anscp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,3].values)
upivpp = np.interp(ansiv,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,5].values)
upimtppp = np.interp(ansimtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,5].values)
upcmtppp = np.interp(anscmtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,5].values)
pimpp = np.interp(ansimtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
pcmpp = np.interp(anscmtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
timpp = np.interp(ansimtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,0].values)
tcmpp = np.interp(anscmtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,0].values)

print('\n')
print('\nANEOS model conditions for shock-induced vaporization on the POROUS Hugoniot:',round((1-r00/r0)*100.),'% porous')
print('Shock pressure, Temperature (GPa, K) to model IV sp. entropy (kJ/K/kg): ',round(pivpp), round(tivpp))
print('Shock pressure, Temperature (GPa, K) to model CP sp. entropy (kJ/K/kg): ',round(pcppp), round(tcppp))
print('Impact velocity for IM (km/s):',upimtppp*2.)
print('Impact velocity for CM (km/s):',upcmtppp*2.)
print('Impact velocity for IV (km/s):',upivpp*2.)
print('Shock pressure, Temperature (GPa, K) to model IM sp. entropy (kJ/K/kg): ',round(pimpp), round(timpp))
print('Shock pressure, Temperature (GPa, K) to model CM sp. entropy (kJ/K/kg): ',round(pcmpp), round(tcmpp))
print('\n')

# 1 bar parameters for plots
s1biv=np.interp(1.E-4,np.flipud(vcarr[:,3]),np.flipud(vcarr[:,7]))/1.e3 # kJ/K/kg needs x value increasing
s1bcv=np.interp(1.E-4,np.flipud(vcarr[:,3]),np.flipud(vcarr[:,8]))/1.e3 # kJ/K/kg needs x value increasing
t1biv=np.interp(1.E-4,np.flipud(vcarr[:,3]),np.flipud(vcarr[:,0])) # K needs x value increasing
r1biv=np.interp(1.E-4,np.flipud(vcarr[:,3]),np.flipud(vcarr[:,1]))/1.e3 # g/cm3 needs x value increasing
#print('1bar SIV, TIV, RIV, SCV=',s1biv,t1biv,r1biv,s1bcv)


#======================LOTS OF PLOTS============================
# Plot aneos phase boundaries with focus on the vapor curve
sfont = 15
fig, axes = plt.subplots(nrows=4, ncols=2, figsize=(14,24))
plt.subplots_adjust(wspace=0.5)

#------------------------------
ai=0
aj=0
axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Temperature [K]',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].plot(vcarr[:,7]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[ai,aj].plot(vcarr[:,8]/1.e3,vcarr[:,0],color="black")
axes[ai,aj].plot(vcarr[0,7]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,7]/1.e3,mcarr[:,0],color="black")
    axes[ai,aj].plot(mcarr[:,8]/1.e3,mcarr[:,0],color="black")
axes[ai,aj].plot(s1biv,t1biv,'s',color='black',label='IV 1 bar ANEOS')


axes[ai,aj].set_ylim(0,1.5*antcp)
axes[ai,aj].set_xlim(0,14)

#-------------------------
# density-pressure
ai=0
aj=1
axes[ai,aj].loglog(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(1.e-5,300)
axes[ai,aj].set_xlim(1.e-1,8)
axes[ai,aj].plot(r1biv,1.E-4,'s',color='black',label='IV 1 bar ANEOS')
axes[ai,aj].plot(2.968,1.E-4,'s',color='orange',label='MELTS MP Berman')
axes[ai,aj].plot(2.687,1.E-4,'s',color='orange',label='MELTS MP Lange')
axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot
axes[ai,aj].plot(hcarr[0,0]/1.e3,hcarr[0,2],'o',color=style3[1]) # ANEOS Hugoniot initial


axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#------
ai=1
aj=0

axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].semilogy(vcarr[:,7]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].semilogy(vcarr[:,8]/1.e3,vcarr[:,3],color="black")
axes[ai,aj].plot(vcarr[0,7]/1.e3,vcarr[0,3],'ko')
if imc > -1 :
    axes[ai,aj].plot(mcarr[3:,7]/1.e3,mcarr[3:,3],color="black")
    axes[ai,aj].plot(mcarr[3:,8]/1.e3,mcarr[3:,4],color="black")
axes[ai,aj].plot(s1biv,1.e-4,'s',color='black',label='IV 1 bar ANEOS')
axes[ai,aj].plot(hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values,style1[0],color='red',markersize=style1[2],label=style1[3])
axes[ai,aj].plot(hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values,'--',color='red',markersize=style1[2],label=style1[3])

axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',label='Entropy analysis (Davies et al. in prep.)')

axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3-zhugdatarr.iloc[:,6].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',linestyle=':')
axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3+zhugdatarr.iloc[:,6].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',linestyle=':')


piv = np.interp(s1biv,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values)
pcp = np.interp(anscp,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values)
pcmtp = np.interp(anscmtp,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values)
pimtp = np.interp(ansimtp,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values)
axes[ai,aj].plot(ansimtp,pimtp,'s',color='red',label='IM '+str(pimtp)[0:4]+' GPa')
axes[ai,aj].plot(anscmtp,pcmtp,'s',color='red',label='CM '+str(pcmtp)[0:4]+' GPa')
axes[ai,aj].plot(anscp,pcp,'s',color='red',label='CP '+str(pcp)[0:4]+' GPa')

axes[ai,aj].set_ylim(1.e-10,10000)
axes[ai,aj].set_xlim(0,14)

#------
ai=1
aj=1

axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].semilogy(vcarr[:,7]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].semilogy(vcarr[:,8]/1.e3,vcarr[:,3],color="black")
axes[ai,aj].plot(vcarr[0,7]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,7]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,8]/1.e3,mcarr[:,4],color="black")
axes[ai,aj].plot(zhugdatarr.iloc[:,2].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',label='Z (Davies et al.))')
axes[ai,aj].plot(hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
axes[ai,aj].plot(hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hugporous2datarr.iloc[:,4].values*1.e3,hugporous2datarr.iloc[:,2].values,style2[0],color='red',markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hcarr[:,5]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot
axes[ai,aj].plot(hcarr[0,5]/1.e3,hcarr[0,2],'o',color=style3[1]) # ANEOS Hugoniot
tmp = hcarr.shape
pivorig = np.interp(s1biv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
pcporig = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
piv = np.interp(s1biv,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values)
pcp = np.interp(anscp,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values)
pimpp = np.interp(ansimtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
pcmpp = np.interp(anscmtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)

zpiv = np.interp(s1biv,zhugdatarr.iloc[:,2].values/1.e3,zhugdatarr.iloc[:,0].values)/1.e9
zpcp = np.interp(anscp,zhugdatarr.iloc[:,2].values/1.e3,zhugdatarr.iloc[:,0].values)/1.e9

axes[ai,aj].plot(s1biv,piv,'s',color='red',label='ANEOS IV '+str(piv)[0:4]+' GPa')
axes[ai,aj].plot(anscp,pcp,'^',color='red',label='ANEOS CP '+str(pcp)[0:4]+' GPa')
axes[ai,aj].plot(s1biv,pivpp,'s',color='blue',label='ANEOS Porous IV '+str(pivpp)[0:4]+' GPa')
axes[ai,aj].plot(anscp,pcppp,'^',color='blue',label='ANEOS Poorus CP '+str(pcppp)[0:4]+' GPa')
axes[ai,aj].plot(s1biv,1.e-4,'s',color='black')#,label='IV 1 bar ANEOS')

axes[ai,aj].plot(s1biv,zpiv,'s',color='green',label='Davies et al. IV '+str(zpiv)[0:4]+' GPa')
axes[ai,aj].plot(anscp,zpcp,'^',color='green',label='Davies et al. CP '+str(zpcp)[0:4]+' GPa')

axes[ai,aj].set_ylim(1.e-5,4000)
axes[ai,aj].set_xlim(0,7)
print('Incipient vaporization pressure (GPa): ',piv)
print('Shock pressure to CP sp. entropy (GPa): ',pcp)
print('Z fit Incipient vaporization pressure (GPa): ',zpiv)
print('Z fit Shock pressure to CP sp. entropy (GPa): ',zpcp)

#-----------
ai=2
aj=0
axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].semilogy(vcarr[:,5]/1.e6,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].semilogy(vcarr[:,6]/1.e6,vcarr[:,3],color="black")
axes[ai,aj].plot(vcarr[0,5]/1.e6,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,5]/1.e6,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,6]/1.e6,mcarr[:,4],color="black")
axes[ai,aj].plot(hugdatarr.iloc[:,3].values,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
axes[ai,aj].plot(hugporousdatarr.iloc[:,3].values,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hcarr[:,4]/1.e6,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot
axes[ai,aj].plot(hcarr[0,4]/1.e6,hcarr[0,2],'o',color=style3[1]) # ANEOS Hugoniot
tmp = hcarr.shape
eivorig = np.interp(s1biv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,4],tmp[0]))
ecporig = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,4],tmp[0]))
eiv = np.interp(s1biv,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,3].values)*1.e6
ecp = np.interp(anscp,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,3].values)*1.e6

axes[ai,aj].plot(eiv/1.e6,piv,'s',color='red',label='IV '+str(eiv/1.e6)[0:4]+' MJ/kg')
axes[ai,aj].plot(ecp/1.e6,pcp,'^',color='red',label='CP '+str(ecp/1.e6)[0:4]+' MJ/kg')
axes[ai,aj].set_ylim(1.e-5,pcp*2.)
axes[ai,aj].set_xlim(0,ecp*1.1/1.e6)

#----------
ai=2
aj=1
axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Temperature (K)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].plot(vcarr[:,7]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[ai,aj].plot(vcarr[:,8]/1.e3,vcarr[:,0],color="black")
axes[ai,aj].plot(vcarr[0,7]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,7]/1.e3,mcarr[:,0],color="black")
    axes[ai,aj].plot(mcarr[:,8]/1.e3,mcarr[:,0],color="black")
axes[ai,aj].plot(hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,0].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
axes[ai,aj].plot(hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,0].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])
axes[ai,aj].plot(hcarr[:,5]/1.e3,hcarr[:,1],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot
axes[ai,aj].plot(hcarr[0,5]/1.e3,hcarr[0,1],'o',color=style3[1]) # ANEOS Hugoniot
tmp = hcarr.shape
tivorig = np.interp(s1biv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))
tcporig = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))
tiv = np.interp(s1biv,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,0].values)
tcp = np.interp(anscp,hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,0].values)

axes[ai,aj].plot(s1biv,tiv,'s',color='red',label='IV '+str(tiv)[0:5]+' K')
axes[ai,aj].plot(anscp,tcp,'^',color='red',label='CP '+str(tcp)[0:5]+' K')
axes[ai,aj].set_ylim(0,tcp*1.25)
axes[ai,aj].set_xlim(1,7)
print("Shock temp. at SIV (K):",tiv)
print("Shock temp. at SCP (K):",tcp)


#-------
ai=3
aj=0
axes[ai,aj].set_xlabel('Temperature (K)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].semilogy(vcarr[:,0],vcarr[:,4],color='black',label=eosname)

if imc > -1:
    axes[ai,aj].semilogy(mcarr[:,0],mcarr[:,3],color='black',label=eosname)

axes[ai,aj].set_xlim(0,10000)
axes[ai,aj].set_ylim(1.e-16,100)


#-------
#rect = Rectangle((2.24,7300.),2.,3600,linewidth=1,edgecolor='skyblue',facecolor='skyblue')
#axes[0,0].add_patch(rect)

#axes[0,0].plot([s1biv,s1bcv],[6250,6250],label='Pyrolite Caracas',linestyle='-',color='brown')
#axes[0,1].plot([0.6,.7],[0.1,0.1],label='Pyrolite Caracas',linestyle='-',color='brown')
#axes[1,0].plot([s1biv,s1bcv],[0.1,0.1],label='Pyrolite Caracas',linestyle='-',color='brown')
#axes[0,0].plot(5.5,6700,'x',label='Fo Sandia (prelim)',markersize=10)
#axes[0,1].plot(0.55,0.179,'x',label='Fo Sandia (prelim)',markersize=10,color='green')
#axes[1,0].plot(5.5,0.19,'x',label='Fo Sandia (prelim)',markersize=10)
#axes[0,0].plot([s1biv,s1bcv],[6600,6600],linestyle='-',label='En Xiao & Stixrude 2018',color='brown')
axes[0,1].plot(0.4822,0.1414,'+',label='En Xiao & Stixrude 2018',markersize=10,color='brown')
#axes[1,0].plot([s1biv,s1bcv],[0.1414,0.1414],linestyle='-',color='green',label='En Xiao & Stixrude 2018')
axes[0,0].plot(5.149,5130,'^',label='Qtz Kraus et al. 2012',markersize=10,color='cyan')
axes[0,1].plot(0.508,0.132,'^',label='Qtz Kraus et al. 2012',markersize=10,color='cyan')
#axes[1,0].plot(5.149,0.132,'^',label='Qtz Kraus et al 2012',markersize=10)


# Data on forsterite
# 0.6689 kJ/kg STP entropy from Robie et al. 1982
axes[0,0].plot(0.669,298,'+',color='orange',label='STP')
axes[1,1].plot(0.669,1.e-4,'+',color='orange',label='STP')
axes[1,0].plot(0.669,1.e-4,'o',color='orange',label='STP')

# 1 bar melting point entropy, enthalpy and temperature from Richet et al. 1993
axes[0,0].plot(3.470,2174,'d',color='orange',label='MP 1 bar Richet et al. 1993')
axes[1,0].plot(3.470,1.e-4,'d',color='orange',label='MP 1 bar Richet et al. 1993')
axes[1,1].plot(3.470,1.e-4,'d',color='orange',label='MP 1 bar Richet et al. 1993')


# Triple point from Nagahara et al. 1994
#Triple point of forsterite 5.2e-5 bar, 1890 C (2163 K), enthalpy of evaporation 543+-33 kJ/mol, entropy of evaporation 169+-21 J/mol/K. (Nagahara et al. 1994). This should be near the entropy of melting at 1 bar.<br>
#dS of vaporization 1201.20 kJ/K/kg
axes[0,0].plot(3.470,2163,'s',color='orange',label='TP Nagahara et al. 1994')
#axes[1,1].plot(3.470,5.2e-9,'s',color='orange',label='TP Nagahara et al. 1994')
axes[1,0].plot(3.470,5.2e-9,'s',color='orange',label='TP Nagahara et al. 1994')
axes[1,0].plot(ansimtp,5.2e-9,'s',color='orange',label='TP',mfc='none')
axes[3,0].plot(2163.,5.2e-9,'s',color='orange',label='TP Nagahara et al. 1994')

axes[3,0].plot(2174,1.e-4,'d',color='orange',label='Richet et al. 1993')
axes[3,0].plot(2250,13.,'s',color='orange',label='de Koker et al. 2009')

# Nagahara et al. 1994 vapor curve of forsterite
tvapfo = np.arange(46)*10.+1400.+273. # in C to K
#pvapfo = np.exp(-77955.0/tvapfo+27.7)
pvapfonagahara = np.exp(169.-543.e3/(8.314*(tvapfo))) 
#print(pvapfonagahara)
#print(tvapfo)
#print(pvapfo)
#axes[3,0].plot(tvapfo+273.,pvapfo*1.e5/1.e9,linestyle='-',color='orange',label='Sublimation curve\nMysen & Kushiro 1988')
#axes[3,0].plot(tvapfo,pvapfonagahara*1.e5/1.e9,linestyle='-',color='green',label='Sublimation curve\nNagahara et al. 1994')
#print(pvapfonagahara)
tt=np.zeros(7)
tt.fill(273.)
tt=tt+np.asarray([1400.,1500.,1600.,1700.,1725.,1760.,1800.])
axes[3,0].plot(tt,np.asarray([8.79E-9,5.98E-8,3.85E-7,2.7E-6,4.21E-6,9.58E-6,1.52E-5])/1.e4,'s',color='orange',label='Nagahara et al. 1994')

# Mysen & Kushiro 1988 vapor curve of forsterite
tvapfo = np.arange(1000)+1000. # in C
pvapfo = np.exp(-77955.0/tvapfo+27.7)
pvapfonagahara = np.exp(169.-543.e3/(8.314*(tvapfo+273.0))) # this makes no sense
#print(pvapfonagahara)
#print(tvapfo)
#print(pvapfo)
#axes[3,0].plot(tvapfo+273.,pvapfo*1.e5/1.e9,linestyle='-',color='orange',label='Sublimation curve\nMysen & Kushiro 1988')
#axes[3,0].plot(tvapfo+273.,pvapfonagahara*1.e5/1.e9,linestyle='-',color='green',label='Sublimation curve\nNagahara et al. 1994')

#Centolanzi and Chapman Tektite vapor curve
tvaptek = np.arange(1400)+1700. # in K
pvaptek = np.exp(-57400.0/tvaptek+18.5)*101325. # in atm to Pa
axes[3,0].plot(tvaptek,pvaptek/1.e9,linestyle='-',color='cyan',label='Vapor curve tektites\nCentolanzi & Chapman 1966')


# don't show a plot in lower right
axes[3,1].axis("off")

axes[0,0].legend(fontsize=sfont-5)
axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
axes[1,1].legend(fontsize=sfont-5)
axes[2,0].legend(fontsize=sfont-5)
axes[2,1].legend(fontsize=sfont-5)
axes[3,0].legend(fontsize=sfont-5)

plt.tight_layout(pad=0.4,w_pad=0.5,h_pad=1.0)
plt.savefig('phase-diagram-fig-test.pdf', format='pdf', dpi=1000,transparent=True)
ANEOS Calculated Critical point:
Temperature (K):  6487.2
Density (g/cm$^3$):  0.533792
Pressure (GPa):  0.242898
Sp. Energy (MJ/kg):  19.2063
Sp. Entropy (kJ/kg):  6.7908599999999995
MELT at the triple point T, SIM, SCM, SCV:  2163.0 3.0883000000000003 3.5507 11.7591

ANEOS Calculated 1-bar boiling point:
Sp. Entropy for incipient vaporization IV (kJ/kg):  4.25519 . check 1: 1.0
Sp. Entropy for complete vaporization CV (kJ/kg):  9.003680000000001
Temperature at boiling (K):  3331
Density at boiling (g/cm3):  2.515

ANEOS 1-bar melting point is defined by the input parameters. See plots below.
Triple point estimate:
Sp. Entropy for incipient melting IM at TP (kJ/kg):  3.0883000000000003
Sp. Entropy for complete melting CM at TP (kJ/kg):  3.5507

ANEOS model conditions for shock-induced vaporization:
Impact velocity for IM at TP (km/s): 8.781519783197833
Impact velocity for CM at TP (km/s): 10.18493850996852
Impact velocity for IV at 1 bar (km/s): 12.36914009433962
Shock pressure (GPa) to model IV sp. entropy (kJ/K/kg):  273.0
Shock pressure (GPa) to model CP sp. entropy (kJ/K/kg):  972.0
Shock temperature (K) at model SIV: 6187.0
Shock temperature (K) at model SCP: 38496.0
Shock pressure, Temperature (GPa, K) to model IM sp. entropy (kJ/K/kg):  162.0 3299.0
Shock pressure, Temperature (GPa, K) to model CM sp. entropy (kJ/K/kg):  202.0 4555.0



ANEOS model conditions for shock-induced vaporization on the POROUS Hugoniot: 8 % porous
Shock pressure, Temperature (GPa, K) to model IV sp. entropy (kJ/K/kg):  284.0 6241.0
Shock pressure, Temperature (GPa, K) to model CP sp. entropy (kJ/K/kg):  980.0 38353.0
Impact velocity for IM (km/s): 9.315484647804878
Impact velocity for CM (km/s): 10.656018954343487
Impact velocity for IV (km/s): 12.771140693142804
Shock pressure, Temperature (GPa, K) to model IM sp. entropy (kJ/K/kg):  173.0 3335.0
Shock pressure, Temperature (GPa, K) to model CM sp. entropy (kJ/K/kg):  213.0 4603.0


Incipient vaporization pressure (GPa):  279.0485566926938
Shock pressure to CP sp. entropy (GPa):  971.2693568785078
Z fit Incipient vaporization pressure (GPa):  281.73686304435887
Z fit Shock pressure to CP sp. entropy (GPa):  1011.7940913682271
Shock temp. at SIV (K): 6213.510875627439
Shock temp. at SCP (K): 38254.89694401759
In [12]:
# make the line colors and such consistent across all the plots
style1 = ['-','blue',3,'Tabulated STP Hugoniot'] # eos table interpolated STP Hugoniot
style2 = ['--','blue',3,'Tabulated Porous Hugoniot'] # eos table interpolated porous Hugoniot
style3 = ['-','red',3,'ANEOS Hugoniot'] # ANEOS Hugoniot returned from ANHUG in ANEOS.OUTPUT
style4 = ['-','orange',3,'ANEOS Liquid Hugoniot'] # ANEOS Hugoniot returned from ANHUG in ANEOS.OUTPUT for liquid initial conditions, stored as a file
#
# Display the initial conditions for the Hugoniot in ANEOS.OUTPUT    
print('\nRequested ANEOS Hugoniot initial state from (THUG,RHUG) (red and blue curves in plots below):')
print('Initial Pressure (GPa):',hcarr[0,2])
print('Initial Temperature (K):',hcarr[0,1])
print('Initial Sp. Entropy (kJ/K/kg):',hcarr[0,5]/1.e3)
print('Initial Sp. Internal Energy (kJ/kg):',hcarr[0,4]/1.e3)
print('Initial Density (g/cm3):',hcarr[0,0]/1.e3)
#
#
#======================LOTS OF PLOTS============================
# Plot aneos phase boundaries with focus on the vapor curve
sfont = 15
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(14,10))
plt.subplots_adjust(wspace=0.5)

coltil="darkgrey"
dskip=10
relthick=4


#    (dens < tilleos[r0]) and (eng < tilleos[ECV] and (eng > tilleos[EIV]))
zzz1 = np.where(till2earr > dunitetill[2]/1.e6)
zzz2 = np.where(till2earr < dunitetill[3]/1.e6)
#print(len(zzz1[0]),len(zzz2[0]))
#print(min(zzz1[0]),max(zzz2[0]))
tillintpmaxarr = np.zeros(max(zzz2[0])-min(zzz1[0]))
tillintpminarr = np.zeros(max(zzz2[0])-min(zzz1[0]))
tillintpminarr[:]=1.e-16 # GPa
tillintearr = np.zeros(max(zzz2[0])-min(zzz1[0]))
iiie=0
for iie in range(min(zzz1[0]),max(zzz2[0])):
    zzz3 = np.where(andarr < dunitetill[0]/1.e3)
    #print(iie,till2earr[iie],max(till2parr[iie,zzz3[0]]))
    #axes[ai,aj].plot(till2earr[iie],max(till2parr[iie,zzz3[0]]),'o',color='black')
    tillintpmaxarr[iiie]=max(till2parr[iie,zzz3[0]])
    tillintearr[iiie]=till2earr[iie]
    iiie=iiie+1


#-------
ai=0
aj=0
axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


logdcolmin=-15
logdcolmax=-0.3
for iid in range(0,len(andarr)-1,dskip):
    if andarr[iid] < 0.5:
        icolscale = (np.log10(andarr[iid])-logdcolmin)/(logdcolmax-logdcolmin)*0.6
        if icolscale > 0.6:
            icolscale=0.6
        if icolscale < 0:
            icolscale=0
    else:
        icolscale = (andarr[iid]-0.5)/(5-0.5)*0.4+0.6
        if icolscale > 1.:
            icolscale=1.
        if icolscale < 0.6:
            icolscale=0.6
        
    col=local_cmaps.parula(icolscale)
    #print(iid,andarr[iid],np.log10(andarr[iid]),icolscale)
    axes[ai,aj].loglog(anearr[:,iid],anparr[:,iid],'o',markersize=2,color=col)

axes[ai,aj].loglog(vcarr[:,5]/1.e6,vcarr[:,4],color="black")
axes[ai,aj].loglog(vcarr[:,6]/1.e6,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,5]/1.e6,vcarr[0,4],'ko')
if imc > -1:
    vctt = np.where(vcarr[:,0] == 2163.)
    print(vcarr[vctt[0],4])
    mcarr[3,3]=vcarr[vctt[0],4]
    mcarr[3,4]=vcarr[vctt[0],4]
    mctt = np.where(mcarr[:,0] >= 2163.)
    axes[ai,aj].plot(mcarr[mctt[0],5]/1.e6,mcarr[mctt[0],3],color="black")
    axes[ai,aj].plot(mcarr[mctt[0],6]/1.e6,mcarr[mctt[0],4],color="black")
    mctt = np.where(mcarr[:,0] == 2163.)
    axes[ai,aj].plot([mcarr[mctt[0],6]/1.e6,vcarr[vctt[0],6]/1.e6],[vcarr[vctt[0],4],vcarr[vctt[0],4]],color='black',linewidth=3)
axes[ai,aj].set_ylim(1.e-18,1000.)
axes[ai,aj].set_xlim(1,40.)
#axes[ai,aj].set_title("ANEOS - isochores")


#axes[ai,aj].legend(fontsize=sfont-5)
axes[ai,aj].text(1.1,1.e-3,'A. ANEOS',fontsize=labsize)
labsize2=14
axes[ai,aj].text(2.1,1.e-6,'S',fontsize=labsize2)
axes[ai,aj].text(2.9,1.e-6,'S+L',fontsize=labsize2)
axes[ai,aj].text(4.05,1.e-6,'L',fontsize=labsize2)
axes[ai,aj].text(12,1.e-6,'L+V',fontsize=labsize2)
axes[ai,aj].text(25,1.e-6,'V',fontsize=labsize2)
axes[ai,aj].text(12,1.e-12,'S+V',fontsize=labsize2)


#-------
ai=0
aj=1
axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

logdcolmin=-15
logdcolmax=-0.3
for iid in range(0,len(andarr)-1,dskip):
    if andarr[iid] < 0.5:
        icolscale = (np.log10(andarr[iid])-logdcolmin)/(logdcolmax-logdcolmin)*0.6
        if icolscale > 0.6:
            icolscale=0.6
        if icolscale < 0:
            icolscale=0
    else:
        icolscale = (andarr[iid]-0.5)/(5-0.5)*0.4+0.6
        if icolscale > 1.:
            icolscale=1.
        if icolscale < 0.6:
            icolscale=0.6

    col=local_cmaps.parula(icolscale)
    axes[ai,aj].loglog(till2earr,till2parr[:,iid],'o',markersize=2,color=col)

#zzz = np.where(vcarr[:,0] = 2163.)
#vcarr[zzz[0],3]=vcarr[zzz[0],4]
axes[ai,aj].loglog(vcarr[:,5]/1.e6,vcarr[:,4],color=coltil)
axes[ai,aj].loglog(vcarr[:,6]/1.e6,vcarr[:,4],color=coltil)
axes[ai,aj].plot(vcarr[0,5]/1.e6,vcarr[0,3],'o',color=coltil)
if imc > -1:
    vctt = np.where(vcarr[:,0] == 2163.)
#    print(vcarr[vctt[0],4])
    mcarr[3,3]=vcarr[vctt[0],4]
    mcarr[3,4]=vcarr[vctt[0],4]
    mctt = np.where(mcarr[:,0] >= 2163.)
    axes[ai,aj].plot(mcarr[mctt[0],5]/1.e6,mcarr[mctt[0],3],color=coltil)
    axes[ai,aj].plot(mcarr[mctt[0],6]/1.e6,mcarr[mctt[0],4],color=coltil)
    mctt = np.where(mcarr[:,0] == 2163.)
    axes[ai,aj].plot([mcarr[mctt[0],6]/1.e6,vcarr[vctt[0],6]/1.e6],[vcarr[vctt[0],4],vcarr[vctt[0],4]],color=coltil,linewidth=3)
axes[ai,aj].set_ylim(1.e-18,1000.)
axes[ai,aj].set_xlim(1,40.)
#axes[ai,aj].set_title("Tillotson - isochores")

# draw a box around the interpolated region
axes[ai,aj].plot(tillintearr,tillintpmaxarr,'-',color='black')
axes[ai,aj].plot(tillintearr,tillintpminarr,'-',color='black')
axes[ai,aj].plot([min(tillintearr),min(tillintearr)],[1.e-16,min(tillintpmaxarr)],'-',color='black')
axes[ai,aj].plot([max(tillintearr),max(tillintearr)],[1.e-16,max(tillintpmaxarr)],'-',color='black')

#axes[ai,aj].legend(fontsize=sfont-5)

axes[ai,aj].text(1.1,1.e-3,'B. Tillotson',fontsize=labsize)



#--------------------------
# COMPARE ISENTROPES BETWEEN TILLOTSON AND ANEOS STARTING FROM NEAR 500 GPa
#
ptarget = 500.0 # GPa
# Tillotson Isentropei
tmp = hugtilldatarr.shape
rhug = np.interp(ptarget,np.resize(hugtilldatarr.iloc[:,2].values,tmp[0]),np.resize(hugtilldatarr.iloc[:,1].values,tmp[0])) # g/cm3
irh=int(np.round(np.interp(rhug,andarr,np.arange(dsize))))
rhug = andarr[irh] # begin with a density exactly on the grid
phug = np.interp(rhug,np.resize(hugtilldatarr.iloc[:,1].values,tmp[0]),np.resize(hugtilldatarr.iloc[:,2].values,tmp[0])) # GPa
ehug = np.interp(phug,till2parr[:,irh],till2earr) # MJ/kg
uphug = np.interp(phug,np.resize(hugtilldatarr.iloc[:,2].values,tmp[0]),np.resize(hugtilldatarr.iloc[:,5].values,tmp[0]))*1.e3 # m/s
cshug = np.interp(ehug,till2earr,till2csarr[:,irh]) # m/s
print('Tillotson Hugoniot starting point:')
print('P, rho, E, up, cs: ',phug,rhug,ehug,uphug,cshug)

plast   = phug
uplast  = uphug
cslast  = cshug
tillsparr = np.zeros(dsize)
tillsearr = np.zeros(dsize)
tillsuparr = np.zeros(dsize)
tillscsarr = np.zeros(dsize)
tillsparr[irh] = phug # GPa
tillsearr[irh] = ehug # MJ/kg
tillsuparr[irh] = uphug # m/s
tillscsarr[irh] = cshug # m/s
itillend = irh+1
itillstart = irh
for iir in range(irh-1,0,-1):
    dp = cslast*cslast*(andarr[iir+1]*1.e3-andarr[iir]*1.e3)/1.e9 #GPa
    pnew = plast - dp
    enew = np.interp(pnew,till2parr[:,iir],till2earr)
    csnew = np.interp(enew,till2earr,till2csarr[:,iir]) # m/s
    upnew = uplast + (1./(andarr[iir]*1000.))/cslast*dp*1.e9
    tillsparr[iir] = pnew # GPa
    tillsearr[iir] = enew # MJ/kg
    tillsuparr[iir] = upnew # m/s
    tillscsarr[iir] = csnew # m/s
    if pnew>0:
        #print('P, rho, E, up, cs: ',pnew,andarr[iir],enew,upnew,csnew)
        itillstart = iir-1
    plast  = pnew
    uplast = upnew
    cslast = csnew

#print(tillscsarr)   

# ANEOS ISENTROPE NEAR SAME PRESSURE
tmp = hugdatarr.shape
ansparr = np.zeros(dsize)
ansearr = np.zeros(dsize)
ansuparr = np.zeros(dsize)
anscsarr = np.zeros(dsize)
rhug = np.interp(ptarget,np.resize(hugdatarr.iloc[:,2].values,tmp[0]),np.resize(hugdatarr.iloc[:,1].values,tmp[0])) # g/cm3
irh=int(np.round(np.interp(rhug,andarr,np.arange(dsize))))
rhug = andarr[irh] # start with the closets density exactly on the grid
# find pressure on hugoniot matching rhug
phug = np.interp(rhug,np.resize(hugdatarr.iloc[:,1].values,tmp[0]),np.resize(hugdatarr.iloc[:,2].values,tmp[0])) # GPa
uphug = np.interp(phug,np.resize(hugdatarr.iloc[:,2].values,tmp[0]),np.resize(hugdatarr.iloc[:,5].values,tmp[0]))*1.e3 # m/s
ansval = np.interp(phug,np.resize(hugdatarr.iloc[:,2].values,tmp[0]),np.resize(hugdatarr.iloc[:,4].values,tmp[0])) # MJ/K/kg
thug = np.interp(phug,np.resize(hugdatarr.iloc[:,2].values,tmp[0]),np.resize(hugdatarr.iloc[:,0].values,tmp[0])) # K
cshug = np.interp(thug,antarr,ancarr[:,irh])/1.e2 # m/s
plast = phug
uplast = uphug
cslast = cshug
ansparr[irh] = phug
ansuparr[irh] = uphug
ansearr[irh] = np.interp(phug,anparr[:,irh],anearr[:,irh])
anscsarr[irh] = cshug
#
print('ANEOS Hugoniot starting point:')
print('P, rho, T, S, up, cs: ',phug,rhug,thug,ansval,uphug, cshug)
for iir in range(irh-1,0,-1):
    pnew = np.interp(ansval,ansarr[:,iir],anparr[:,iir]) # GPa
    enew = np.interp(ansval,ansarr[:,iir],anearr[:,iir]) # MJ/kg
    csnew = np.interp(ansval,ansarr[:,iir],ancarr[:,iir])/1.e2 # cm -> m/s
    upnew = uplast + (1./(andarr[iir]*1000.))/(cslast)*(plast-pnew)*1.e9 # m/s
    ansparr[iir] = pnew # GPa
    ansearr[iir] = enew # MJ/kg
    ansuparr[iir] = upnew # m/s
    anscsarr[iir] = csnew # m/s
    #print('P, rho, E, up, cs: ',pnew,andarr[iir],enew,upnew,csnew)
    plast  = pnew
    uplast = upnew
    cslast  = csnew


# plot tillotson release in EOS plot
indtillcs = np.where(tillscsarr > 1.e-8)
#axes[ai,aj].plot(tillsearr[itillstart:itillend],tillsparr[itillstart:itillend],'-+',color='green',label='Tillotson release 500 GPa')
axes[ai,aj].plot(tillsearr[indtillcs],tillsparr[indtillcs],'-',color='red',linewidth=relthick)
ai=0
aj=0
axes[ai,aj].plot(ansearr[0:irh+1],ansparr[0:irh+1],'-',color='blue',linewidth=relthick)

#------- plot rho vs. P

ai=1
aj=0

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
#axes[ai,aj].set_ylim(0,600)
#axes[ai,aj].set_xlim(0,7)
axes[ai,aj].set_ylim(1.e-9,1000)
axes[ai,aj].set_xlim(1.e-9,10)
axes[ai,aj].text(0.2e-8,0.5e-8,'C',fontsize=labsize)

axes[ai,aj].plot(hugtilldatarr.iloc[:,1].values,hugtilldatarr.iloc[:,2].values,color='grey',label='Tillotson Hugoniot')
axes[ai,aj].loglog(hugdatarr.iloc[:,1].values,hugdatarr.iloc[:,2].values,style1[0],color='black',markersize=style1[2],label='ANEOS Hugoniot')

axes[ai,aj].plot(andarr[indtillcs],tillsparr[indtillcs],'-',color='red',linewidth=relthick,label='Tillotson release 500 GPa')
axes[ai,aj].plot(andarr[0:irh+1],ansparr[0:irh+1],'-',color='blue',linewidth=relthick,label='ANEOS release 500 GPa')
axes[ai,aj].legend(fontsize=sfont-5)
#axes[ai,aj].set_title("Release from 500 GPa")

#------- plot Up vs. P

ai=1
aj=1

axes[ai,aj].set_xlabel('Particle Velocity (km/s)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].set_ylim(1.e-9,1000)
axes[ai,aj].set_xlim(5,30)
axes[ai,aj].text(6,0.5e-8,'D',fontsize=labsize)

axes[ai,aj].semilogy(hugtilldatarr.iloc[:,5].values,hugtilldatarr.iloc[:,2].values,color='grey',label='Tillotson Hugoniot')
axes[ai,aj].semilogy(hugdatarr.iloc[:,5].values,hugdatarr.iloc[:,2].values,style1[0],color='black',markersize=style1[2],label='ANEOS Hugoniot')

axes[ai,aj].semilogy(tillsuparr[indtillcs]/1.e3,tillsparr[indtillcs],'-',color='red',linewidth=relthick,label='Tillotson release 500 GPa')
axes[ai,aj].semilogy(ansuparr[0:irh+1]/1.e3,ansparr[0:irh+1],'-',color='blue',linewidth=relthick,label='ANEOS release 500 GPa')
#axes[ai,aj].set_title("Release from 500 GPa")


#--------------------------
# COMPARE ISENTROPES BETWEEN TILLOTSON AND ANEOS STARTING FROM NEAR 200 GPa
#
#
ptarget = 200.0 # GPa
# Tillotson Isentrope
tmp = hugtilldatarr.shape
rhug = np.interp(ptarget,np.resize(hugtilldatarr.iloc[:,2].values,tmp[0]),np.resize(hugtilldatarr.iloc[:,1].values,tmp[0])) # g/cm3
irh=int(np.round(np.interp(rhug,andarr,np.arange(dsize))))
rhug = andarr[irh] # begin with a density exactly on the grid
phug = np.interp(rhug,np.resize(hugtilldatarr.iloc[:,1].values,tmp[0]),np.resize(hugtilldatarr.iloc[:,2].values,tmp[0])) # GPa
ehug = np.interp(phug,till2parr[:,irh],till2earr) # MJ/kg
uphug = np.interp(phug,np.resize(hugtilldatarr.iloc[:,2].values,tmp[0]),np.resize(hugtilldatarr.iloc[:,5].values,tmp[0]))*1.e3 # m/s
cshug = np.interp(ehug,till2earr,till2csarr[:,irh]) # m/s
print('Tillotson Hugoniot starting point:')
print('P, rho, E, up, cs: ',phug,rhug,ehug,uphug,cshug)

plast   = phug
uplast  = uphug
cslast  = cshug
tillsparr = np.zeros(dsize)
tillsearr = np.zeros(dsize)
tillsuparr = np.zeros(dsize)
tillscsarr = np.zeros(dsize)
tillsparr[irh] = phug # GPa
tillsearr[irh] = ehug # MJ/kg
tillsuparr[irh] = uphug # m/s
tillscsarr[irh] = cshug # m/s
itillend = irh+1
itillstart = irh
for iir in range(irh-1,0,-1):
    dp = cslast*cslast*(andarr[iir+1]*1.e3-andarr[iir]*1.e3)/1.e9 #GPa
    pnew = plast - dp
    enew = np.interp(pnew,till2parr[:,iir],till2earr)
    csnew = np.interp(enew,till2earr,till2csarr[:,iir]) # m/s
    upnew = uplast + (1./(andarr[iir]*1000.))/cslast*dp*1.e9
    tillsparr[iir] = pnew # GPa
    tillsearr[iir] = enew # MJ/kg
    tillsuparr[iir] = upnew # m/s
    tillscsarr[iir] = csnew # m/s
    if pnew>0:
        #print('P, rho, E, up, cs: ',pnew,andarr[iir],enew,upnew,csnew)
        itillstart = iir-1
    plast  = pnew
    uplast = upnew
    cslast = csnew

# ANEOS ISENTROPE NEAR SAME PRESSURE
tmp = hugdatarr.shape
ansparr = np.zeros(dsize)
ansearr = np.zeros(dsize)
ansuparr = np.zeros(dsize)
anscsarr = np.zeros(dsize)
rhug = np.interp(ptarget,np.resize(hugdatarr.iloc[:,2].values,tmp[0]),np.resize(hugdatarr.iloc[:,1].values,tmp[0])) # g/cm3
irh=int(np.round(np.interp(rhug,andarr,np.arange(dsize))))
rhug = andarr[irh] # start with the closets density exactly on the grid
# find pressure on hugoniot matching rhug
phug = np.interp(rhug,np.resize(hugdatarr.iloc[:,1].values,tmp[0]),np.resize(hugdatarr.iloc[:,2].values,tmp[0])) # GPa
uphug = np.interp(phug,np.resize(hugdatarr.iloc[:,2].values,tmp[0]),np.resize(hugdatarr.iloc[:,5].values,tmp[0]))*1.e3 # m/s
ansval = np.interp(phug,np.resize(hugdatarr.iloc[:,2].values,tmp[0]),np.resize(hugdatarr.iloc[:,4].values,tmp[0])) # MJ/K/kg
thug = np.interp(phug,np.resize(hugdatarr.iloc[:,2].values,tmp[0]),np.resize(hugdatarr.iloc[:,0].values,tmp[0])) # K
cshug = np.interp(thug,antarr,ancarr[:,irh])/1.e2 # m/s
plast = phug
uplast = uphug
cslast = cshug
ansparr[irh] = phug
ansuparr[irh] = uphug
ansearr[irh] = np.interp(phug,anparr[:,irh],anearr[:,irh])
anscsarr[irh] = cshug
#
print('ANEOS Hugoniot starting point:')
print('P, rho, T, S, up, cs: ',phug,rhug,thug,ansval,uphug, cshug)
for iir in range(irh-1,0,-1):
    pnew = np.interp(ansval,ansarr[:,iir],anparr[:,iir]) # GPa
    enew = np.interp(ansval,ansarr[:,iir],anearr[:,iir]) # MJ/kg
    csnew = np.interp(ansval,ansarr[:,iir],ancarr[:,iir])/1.e2 # cm -> m/s
    upnew = uplast + (1./(andarr[iir]*1000.))/(cslast)*(plast-pnew)*1.e9 # m/s
    ansparr[iir] = pnew # GPa
    ansearr[iir] = enew # MJ/kg
    ansuparr[iir] = upnew # m/s
    anscsarr[iir] = csnew # m/s
    #print('P, rho, E, up, cs: ',pnew,andarr[iir],enew,upnew,csnew)
    plast  = pnew
    uplast = upnew
    cslast  = csnew

    
#------- add to plots above
# plot tillotson release in EOS plot
indtillcs = np.where(tillscsarr > 1.e-8)
ai=0
aj=0
axes[ai,aj].plot(ansearr[0:irh+1],ansparr[0:irh+1],':',color='blue',linewidth=relthick)
ai=0
aj=1
axes[ai,aj].plot(tillsearr[indtillcs],tillsparr[indtillcs],':',color='red',linewidth=relthick)

ai=1
aj=0
axes[ai,aj].plot(andarr[indtillcs],tillsparr[indtillcs],':',color='red',linewidth=relthick,label='Tillotson release 200 GPa')
axes[ai,aj].plot(andarr[0:irh+1],ansparr[0:irh+1],':',color='blue',linewidth=relthick,label='ANEOS release 200 GPa')
ai=1
aj=1
axes[ai,aj].semilogy(tillsuparr[indtillcs]/1.e3,tillsparr[indtillcs],':',color='red',linewidth=relthick,label='Tillotson release 200 GPa')
axes[ai,aj].semilogy(ansuparr[0:irh+1]/1.e3,ansparr[0:irh+1],':',color='blue',linewidth=relthick,label='ANEOS release 200 GPa')


#axes[0,0].legend(fontsize=sfont-5)
#axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
axes[1,1].legend(fontsize=sfont-5)

plt.tight_layout(pad=0.4,w_pad=0.5,h_pad=1.0)
plt.savefig('comptillotson.pdf', format='pdf', dpi=1000,transparent=True)
Requested ANEOS Hugoniot initial state from (THUG,RHUG) (red and blue curves in plots below):
Initial Pressure (GPa): 4.3093
Initial Temperature (K): 429.41
Initial Sp. Entropy (kJ/K/kg): 0.65088
Initial Sp. Internal Energy (kJ/kg): 214.47
Initial Density (g/cm3): 3.22
[5.66395e-09]
/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_base.py:3507: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=1e-16, top=1e-16
  self.set_ylim(upper, lower, auto=None)
Tillotson Hugoniot starting point:
P, rho, E, up, cs:  496.8333 6.236893 31.155993976926386 7892.527 16332.239880500096
ANEOS Hugoniot starting point:
P, rho, T, S, up, cs:  503.21665294974514 6.732039 16117.8987618354 0.005555063725418792 9029.336513109978 15522.05910935907
Tillotson Hugoniot starting point:
P, rho, E, up, cs:  200.1577999999998 5.51068 10.443072848351822 4567.947999999998 11904.071006823093
ANEOS Hugoniot starting point:
P, rho, T, S, up, cs:  199.16346257494814 5.576699 4286.1005123732675 0.003455661173552817 5112.575535484572 11578.4598916167
In [13]:
colid = [0,.2,.2,.25,.55,.85]
labid = ['New ANEOS','Z fit','Gas gun data','iSALE','GADGET','SPH-CTH','Tillotson']
linid = ['-','-','+','-','-','-']


# read in other vapor curves
aneosoutputfile = open("ANEOS.OUTPUT.canup","r")  
testoutcanup=aneosoutputfile.readlines()
aneosoutputfile.close()
aneosoutputfile = open("ANEOS.OUTPUT.isale","r")  
testoutisale=aneosoutputfile.readlines()
aneosoutputfile.close()
aneosoutputfile = open("ANEOS.OUTPUT.gadget","r")  
testoutgadget=aneosoutputfile.readlines()
aneosoutputfile.close()
#print(*testout)

for i in np.arange(len(testoutcanup)):
    if testoutcanup[i] == '  TWO-PHASE BOUNDARIES\n':
        nvc = nleninit
        ivc = i
        vcarrtmp = np.zeros((nvc,12),dtype=float)
        flag=0
        j=0
        while flag == 0:
            if testoutcanup[j+i+4].find(' anphas') == 0:
                print(testoutcanup[j+i+4])
                vcarrtmp[j,:]=vcarrtmp[j-1,:]
                j=j+1
            else:
                tmp=str.replace(testoutcanup[j+i+4],'D','E')
                tmp3 = tmp[0:157]
                tmp4 = list(tmp3.split())
                if (len(tmp4) >0) and (float(tmp4[3]) > 0) and (float(tmp4[4]) > 0): # stop if the pressures become negative on the vapor curve
                    tmp5 = np.asarray(tmp4)
                    vcarrtmp[j,:] = tmp5[:]
                    j=j+1
                else:
                    flag=1
        vcarrcanup = np.zeros((j,12),dtype=float)
        vcarrcanup[:,:] = vcarrtmp[0:j,:]

for i in np.arange(len(testoutisale)):
    if testoutisale[i] == '  TWO-PHASE BOUNDARIES\n':
        nvc = nleninit
        ivc = i
        vcarrtmp = np.zeros((nvc,12),dtype=float)
        flag=0
        j=0
        while flag == 0:
            if testoutisale[j+i+4].find(' anphas') == 0:
                print(testoutisale[j+i+4])
                vcarrtmp[j,:]=vcarrtmp[j-1,:]
                j=j+1
            else:
                tmp=str.replace(testoutisale[j+i+4],'D','E')
                tmp3 = tmp[0:157]
                tmp4 = list(tmp3.split())
                if (len(tmp4) >0) and (float(tmp4[3]) > 0) and (float(tmp4[4]) > 0): # stop if the pressures become negative on the vapor curve
                    tmp5 = np.asarray(tmp4)
                    vcarrtmp[j,:] = tmp5[:]
                    j=j+1
                else:
                    flag=1
        vcarrisale = np.zeros((j,12),dtype=float)
        vcarrisale[:,:] = vcarrtmp[0:j,:]

for i in np.arange(len(testoutgadget)):
    if testoutgadget[i] == '  TWO-PHASE BOUNDARIES\n':
        nvc = nleninit
        ivc = i
        vcarrtmp = np.zeros((nvc,12),dtype=float)
        flag=0
        j=0
        while flag == 0:
            if testoutgadget[j+i+4].find(' anphas') == 0:
                print(testoutgadget[j+i+4])
                vcarrtmp[j,:]=vcarrtmp[j-1,:]
                j=j+1
            else:
                tmp=str.replace(testoutgadget[j+i+4],'D','E')
                tmp3 = tmp[0:157]
                tmp4 = list(tmp3.split())
                if (len(tmp4) >0) and (float(tmp4[3]) > 0) and (float(tmp4[4]) > 0): # stop if the pressures become negative on the vapor curve
                    tmp5 = np.asarray(tmp4)
                    vcarrtmp[j,:] = tmp5[:]
                    j=j+1
                else:
                    flag=1
        vcarrgadget = np.zeros((j,12),dtype=float)
        vcarrgadget[:,:] = vcarrtmp[0:j,:]



print('ANEOS Calculated Critical point:')
print('Temperature (K): ',vcarr[0,0])
print('Density (g/cm$^3$): ',vcarr[0,1]/1.e3)
print('Pressure (GPa): ', vcarr[0,3])
print('Sp. Energy (MJ/kg): ', vcarr[0,5]/1.e6)
print('Sp. Entropy (kJ/kg): ', vcarr[0,7]/1.e3)
antcp = vcarr[0,0]
anscp = vcarr[0,7]/1.e3 # kJ/kg

# ANEOS model points of reference
antcp = vcarr[0,0] # temperature of CP
anscp = vcarr[0,7]/1.e3 # kJ/K/kg sp. entropy at CP
tmp=vcarr.shape
i1bar = get_indexes(1.e-4,np.resize(vcarr[:,3],tmp[0]))

if meltcurve:
    ansimtp = float(mcarr[3,8]/1.e3)
    anscmtp = float(mcarr[3,7]/1.e3)
    anttp = float(mcarr[3,0])
    ittp = get_indexes(anttp,np.resize(vcarr[:,0],tmp[0]))
else:
    anttp = 2163.
    ansimtp = np.interp(anttp,vcarr[:,0],vcarr[:,7]/1.e3)
    anscmtp = np.interp(anttp,vcarr[:,0],vcarr[:,8]/1.e3)
    ittp=[int(round(np.interp(anttp,vcarr[:,0],np.arange(vcarr.shape[0]))))]

anscvtp = float(vcarr[ittp[0],8]/1.e3)
print('MELT at the triple point T, SIM, SCM, SCV: ',anttp,ansimtp,anscmtp,anscvtp)
ansiv = float(vcarr[i1bar[0],7]/1.e3)
anscv = float(vcarr[i1bar[0],8]/1.e3)
antiv = float(vcarr[i1bar[0],0])
anriv = float(vcarr[i1bar[0],1])
print('\nANEOS Calculated 1-bar boiling point:')
print('Sp. Entropy for incipient vaporization IV (kJ/kg): ', ansiv, '. check 1:', vcarr[i1bar[0],3]*1.e4)
print('Sp. Entropy for complete vaporization CV (kJ/kg): ', anscv)
print('Temperature at boiling (K): ', round(antiv))
print('Density at boiling (g/cm3): ', round(anriv)/1.e3)

print('\nANEOS 1-bar melting point is defined by the input parameters. See plots below.')
print('Triple point estimate:')
print('Sp. Entropy for incipient melting IM at TP (kJ/kg): ', ansimtp)
print('Sp. Entropy for complete melting CM at TP (kJ/kg): ', anscmtp)

tmp = hcarr.shape
piv = np.interp(ansiv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
pcp = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
tiv = np.interp(ansiv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))
tcp = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))
eiv = np.interp(ansiv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,4],tmp[0]))
ecp = np.interp(anscp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,4],tmp[0]))
upiv = np.interp(ansiv,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,7],tmp[0]))
upimtp = np.interp(ansimtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,7],tmp[0]))
upcmtp = np.interp(anscmtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,7],tmp[0]))
pim = np.interp(ansimtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
pcm = np.interp(anscmtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,2],tmp[0]))
tim = np.interp(ansimtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))
tcm = np.interp(anscmtp,np.resize(hcarr[:,5],tmp[0])/1.e3,np.resize(hcarr[:,1],tmp[0]))

#upiv = np.interp(ansiv,np.resize(hugdatarr.iloc[:,5].values,tmp[0])*1.e3,np.resize(hugdatarr.iloc[:,6].values,tmp[0]))
#upimtp = np.interp(ansimtp,np.resize(hugdatarr.iloc[:,5].values,tmp[0])*1.e3,np.resize(hugdatarr.iloc[:,6].values,tmp[0]))
#print(ansimtp,np.resize(hugdatarr.iloc[:,4].values,tmp[0])*1.e3,np.resize(hugdatarr.iloc[:,5].values,tmp[0]))
#print(hcarr.shape)

print('\nANEOS model conditions for shock-induced vaporization:')
print('Impact velocity for IM at TP (km/s):', upimtp*2.)
print('Impact velocity for CM at TP (km/s):', upcmtp*2.)
print('Impact velocity for IV at 1 bar (km/s):', upiv*2.)
print('Shock pressure (GPa) to model IV sp. entropy (kJ/K/kg): ',round(piv))
print('Shock pressure (GPa) to model CP sp. entropy (kJ/K/kg): ',round(pcp))
print("Shock temperature (K) at model SIV:",round(tiv))
print("Shock temperature (K) at model SCP:",round(tcp))
print('Shock pressure, Temperature (GPa, K) to model IM sp. entropy (kJ/K/kg): ',round(pim), round(tim))
print('Shock pressure, Temperature (GPa, K) to model CM sp. entropy (kJ/K/kg): ',round(pcm), round(tcm))


#axes[ai,aj].plot(hugdatarr.iloc[:,4].values*1.e3,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])
#axes[ai,aj].plot(hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values,style2[0],color=style2[1],markersize=style2[2],label=style2[3])

#indt=0
#indd=1
#indp=2
#inde=3
#inds=4
#indup = 5
#indus = 6
tmp = len(hugdatarr.iloc[:,0].values)
pivpp = np.interp(ansiv,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
pcppp = np.interp(anscp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
tivpp = np.interp(ansiv,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,0].values)
tcppp = np.interp(anscp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,0].values)
eivpp = np.interp(ansiv,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,3].values)
ecppp = np.interp(anscp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,3].values)
upivpp = np.interp(ansiv,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,5].values)
upimtppp = np.interp(ansimtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,5].values)
upcmtppp = np.interp(anscmtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,5].values)
pimpp = np.interp(ansimtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
pcmpp = np.interp(anscmtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,2].values)
timpp = np.interp(ansimtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,0].values)
tcmpp = np.interp(anscmtp,hugporousdatarr.iloc[:,4].values*1.e3,hugporousdatarr.iloc[:,0].values)

print('\n')
print('\nANEOS model conditions for shock-induced vaporization on the POROUS Hugoniot:',round((1-r00/r0)*100.),'% porous')
print('Shock pressure, Temperature (GPa, K) to model IV sp. entropy (kJ/K/kg): ',round(pivpp), round(tivpp))
print('Shock pressure, Temperature (GPa, K) to model CP sp. entropy (kJ/K/kg): ',round(pcppp), round(tcppp))
print('Impact velocity for IM (km/s):',upimtppp*2.)
print('Impact velocity for CM (km/s):',upcmtppp*2.)
print('Impact velocity for IV (km/s):',upivpp*2.)
print('Shock pressure, Temperature (GPa, K) to model IM sp. entropy (kJ/K/kg): ',round(pimpp), round(timpp))
print('Shock pressure, Temperature (GPa, K) to model CM sp. entropy (kJ/K/kg): ',round(pcmpp), round(tcmpp))
print('\n')

# 1 bar parameters for plots
s1biv=np.interp(1.E-4,np.flipud(vcarr[:,3]),np.flipud(vcarr[:,7]))/1.e3 # kJ/K/kg needs x value increasing
s1bcv=np.interp(1.E-4,np.flipud(vcarr[:,3]),np.flipud(vcarr[:,8]))/1.e3 # kJ/K/kg needs x value increasing
t1biv=np.interp(1.E-4,np.flipud(vcarr[:,3]),np.flipud(vcarr[:,0])) # K needs x value increasing
r1biv=np.interp(1.E-4,np.flipud(vcarr[:,3]),np.flipud(vcarr[:,1]))/1.e3 # g/cm3 needs x value increasing
#print('1bar SIV, TIV, RIV, SCV=',s1biv,t1biv,r1biv,s1bcv)


#======================LOTS OF PLOTS============================
# Plot aneos phase boundaries with focus on the vapor curve
sfont = 15
fig, axes = plt.subplots(nrows=3, ncols=2, figsize=(14,18))
plt.subplots_adjust(wspace=0.5)

#------------------------------
ai=0
aj=0
axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Temperature [K]',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].plot(vcarr[:,7]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[ai,aj].plot(vcarr[:,8]/1.e3,vcarr[:,0],color="black")
axes[ai,aj].plot(vcarr[0,7]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,7]/1.e3,mcarr[:,0],color="black")
    axes[ai,aj].plot(mcarr[:,8]/1.e3,mcarr[:,0],color="black")
axes[ai,aj].plot(s1biv,t1biv,'s',color='black',label='IV 1 bar ANEOS')

ind=3
col=local_cmaps.parula(colid[ind])
axes[ai,aj].plot(vcarrisale[:,7]/1.e3,vcarrisale[:,0],color=col,label=labid[ind])
axes[ai,aj].plot(vcarrisale[:,8]/1.e3,vcarrisale[:,0],color=col)
axes[ai,aj].plot(vcarrisale[0,7]/1.e3,vcarrisale[0,0],'o',color=col)
ind=4
col=local_cmaps.parula(colid[ind])
axes[ai,aj].plot(vcarrgadget[:,7]/1.e3,vcarrgadget[:,0],color=col,label=labid[ind])
axes[ai,aj].plot(vcarrgadget[:,8]/1.e3,vcarrgadget[:,0],color=col)
axes[ai,aj].plot(vcarrgadget[0,7]/1.e3,vcarrgadget[0,0],'o',color=col)
ind=5
col=local_cmaps.parula(colid[ind])
axes[ai,aj].plot(vcarrcanup[:,7]/1.e3,vcarrcanup[:,0],color=col,label=labid[ind])
axes[ai,aj].plot(vcarrcanup[:,8]/1.e3,vcarrcanup[:,0],color=col)
axes[ai,aj].plot(vcarrcanup[0,7]/1.e3,vcarrcanup[0,0],'o',color=col)


axes[ai,aj].set_ylim(0,1.5*antcp)
axes[ai,aj].set_xlim(0,14)

#-------------------------
# density-pressure
ai=0
aj=1
axes[ai,aj].loglog(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(1.e-10,100)
axes[ai,aj].set_xlim(1.e-11,10)
#axes[ai,aj].plot(r1biv,1.E-4,'s',color='black',label='IV 1 bar ANEOS')
#axes[ai,aj].plot(2.968,1.E-4,'s',color='orange',label='MELTS MP Berman')
#axes[ai,aj].plot(2.687,1.E-4,'s',color='orange',label='MELTS MP Lange')

ind=3
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrisale)
axes[ai,aj].loglog(vcarrtmp[:,1]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].loglog(vcarrtmp[:,2]/1.e3,vcarrtmp[:,4],color=col)
axes[ai,aj].plot(vcarrtmp[0,1]/1.e3,vcarrtmp[0,3],'o',color=col)
ind=4
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrgadget)
axes[ai,aj].loglog(vcarrtmp[:,1]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].loglog(vcarrtmp[:,2]/1.e3,vcarrtmp[:,4],color=col)
axes[ai,aj].plot(vcarrtmp[0,1]/1.e3,vcarrtmp[0,3],'o',color=col)
ind=5
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrcanup)
axes[ai,aj].loglog(vcarrtmp[:,1]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].loglog(vcarrtmp[:,2]/1.e3,vcarrtmp[:,4],color=col)
axes[ai,aj].plot(vcarrtmp[0,1]/1.e3,vcarrtmp[0,3],'o',color=col)


axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#------
ai=1
aj=0

axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].semilogy(vcarr[:,7]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].semilogy(vcarr[:,8]/1.e3,vcarr[:,3],color="black")
axes[ai,aj].plot(vcarr[0,7]/1.e3,vcarr[0,3],'ko')
if imc > -1 :
    axes[ai,aj].plot(mcarr[3:,7]/1.e3,mcarr[3:,3],color="black")
    axes[ai,aj].plot(mcarr[3:,8]/1.e3,mcarr[3:,4],color="black")
axes[ai,aj].plot(s1biv,1.e-4,'s',color='black',label='IV 1 bar ANEOS')

ind=3
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrisale)
axes[ai,aj].semilogy(vcarrtmp[:,7]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].semilogy(vcarrtmp[:,8]/1.e3,vcarrtmp[:,3],color=col)
axes[ai,aj].plot(vcarrtmp[0,7]/1.e3,vcarrtmp[0,3],'o',color=col)
ind=4
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrgadget)
axes[ai,aj].semilogy(vcarrtmp[:,7]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].semilogy(vcarrtmp[:,8]/1.e3,vcarrtmp[:,3],color=col)
axes[ai,aj].plot(vcarrtmp[0,7]/1.e3,vcarrtmp[0,3],'o',color=col)
ind=5
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrcanup)
axes[ai,aj].semilogy(vcarrtmp[:,7]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].semilogy(vcarrtmp[:,8]/1.e3,vcarrtmp[:,3],color=col)
axes[ai,aj].plot(vcarrtmp[0,7]/1.e3,vcarrtmp[0,3],'o',color=col)


axes[ai,aj].set_ylim(1.e-10,10000)
axes[ai,aj].set_xlim(0,14)

#----------
ai=1
aj=1
axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].semilogy(vcarr[:,5]/1.e6,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].semilogy(vcarr[:,6]/1.e6,vcarr[:,3],color="black")
axes[ai,aj].plot(vcarr[0,5]/1.e6,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,5]/1.e6,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,6]/1.e6,mcarr[:,4],color="black")

ind=3
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrisale)    
axes[ai,aj].semilogy(vcarrtmp[:,5]/1.e6,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].semilogy(vcarrtmp[:,6]/1.e6,vcarrtmp[:,3],color=col)
axes[ai,aj].plot(vcarrtmp[0,5]/1.e6,vcarrtmp[0,3],'o',color=col)
ind=4
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrgadget)    
axes[ai,aj].semilogy(vcarrtmp[:,5]/1.e6,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].semilogy(vcarrtmp[:,6]/1.e6,vcarrtmp[:,3],color=col)
axes[ai,aj].plot(vcarrtmp[0,5]/1.e6,vcarrtmp[0,3],'o',color=col)
ind=5
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrcanup)    
axes[ai,aj].semilogy(vcarrtmp[:,5]/1.e6,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].semilogy(vcarrtmp[:,6]/1.e6,vcarrtmp[:,3],color=col)
axes[ai,aj].plot(vcarrtmp[0,5]/1.e6,vcarrtmp[0,3],'o',color=col)

axes[ai,aj].set_ylim(1.e-10,10)
axes[ai,aj].set_xlim(0,35)



#-------
ai=2
aj=0
axes[ai,aj].set_xlabel('Temperature (K)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].semilogy(vcarr[:,0],vcarr[:,4],color='black',label=eosname)

if imc > -1:
    axes[ai,aj].semilogy(mcarr[:,0],mcarr[:,3],color='black')

axes[ai,aj].set_xlim(0,10000)
axes[ai,aj].set_ylim(1.e-16,100)

ind=3
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrisale)    
axes[ai,aj].semilogy(vcarrtmp[:,0],vcarrtmp[:,4],color=col,label=labid[ind])
ind=4
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrgadget)    
axes[ai,aj].semilogy(vcarrtmp[:,0],vcarrtmp[:,4],color=col,label=labid[ind])
ind=5
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrcanup)    
axes[ai,aj].semilogy(vcarrtmp[:,0],vcarrtmp[:,4],color=col,label=labid[ind])


#-------
#rect = Rectangle((2.24,7300.),2.,3600,linewidth=1,edgecolor='skyblue',facecolor='skyblue')
#axes[0,0].add_patch(rect)

#axes[0,0].plot([s1biv,s1bcv],[6250,6250],label='Pyrolite Caracas',linestyle='-',color='brown')
#axes[0,1].plot([0.6,.7],[0.1,0.1],label='Pyrolite Caracas',linestyle='-',color='brown')
#axes[1,0].plot([s1biv,s1bcv],[0.1,0.1],label='Pyrolite Caracas',linestyle='-',color='brown')
#axes[0,0].plot(5.5,6700,'x',label='Fo Sandia (prelim)',markersize=10)
#axes[0,1].plot(0.55,0.179,'x',label='Fo Sandia (prelim)',markersize=10,color='green')
#axes[1,0].plot(5.5,0.19,'x',label='Fo Sandia (prelim)',markersize=10)
#axes[0,0].plot([s1biv,s1bcv],[6600,6600],linestyle='-',label='En Xiao & Stixrude 2018',color='brown')
axes[0,1].plot(0.4822,0.1414,'+',label='En Xiao & Stixrude 2018',markersize=10,color='brown')
#axes[1,0].plot([s1biv,s1bcv],[0.1414,0.1414],linestyle='-',color='green',label='En Xiao & Stixrude 2018')
axes[0,0].plot(5.149,5130,'^',label='Qtz Kraus et al. 2012',markersize=10,color='cyan')
axes[0,1].plot(0.508,0.132,'^',label='Qtz Kraus et al. 2012',markersize=10,color='cyan')
#axes[1,0].plot(5.149,0.132,'^',label='Qtz Kraus et al 2012',markersize=10)


# Data on forsterite
# 0.6689 kJ/kg STP entropy from Robie et al. 1982
axes[0,0].plot(0.669,298,'+',color='orange',label='STP')
axes[1,1].plot(0.669,1.e-4,'+',color='orange',label='STP')
axes[1,0].plot(0.669,1.e-4,'o',color='orange',label='STP')

# 1 bar melting point entropy, enthalpy and temperature from Richet et al. 1993
axes[0,0].plot(3.470,2174,'d',color='orange',label='MP 1 bar Richet et al. 1993')
axes[1,0].plot(3.470,1.e-4,'d',color='orange',label='MP 1 bar Richet et al. 1993')
axes[1,1].plot(3.470,1.e-4,'d',color='orange',label='MP 1 bar Richet et al. 1993')


# Triple point from Nagahara et al. 1994
#Triple point of forsterite 5.2e-5 bar, 1890 C (2163 K), enthalpy of evaporation 543+-33 kJ/mol, entropy of evaporation 169+-21 J/mol/K. (Nagahara et al. 1994). This should be near the entropy of melting at 1 bar.<br>
#dS of vaporization 1201.20 kJ/K/kg
axes[0,0].plot(3.470,2163,'s',color='orange',label='TP Nagahara et al. 1994')
#axes[1,1].plot(3.470,5.2e-9,'s',color='orange',label='TP Nagahara et al. 1994')
axes[1,0].plot(3.470,5.2e-9,'s',color='orange',label='TP Nagahara et al. 1994')
axes[1,0].plot(ansimtp,5.2e-9,'s',color='orange',label='TP',mfc='none')
axes[2,0].plot(2163.,5.2e-9,'s',color='orange',label='TP Nagahara et al. 1994')

axes[2,0].plot(2174,1.e-4,'d',color='orange',label='Richet et al. 1993')
axes[2,0].plot(2250,13.,'s',color='orange',label='de Koker et al. 2009')

# Nagahara et al. 1994 vapor curve of forsterite
tvapfo = np.arange(46)*10.+1400.+273. # in C to K
#pvapfo = np.exp(-77955.0/tvapfo+27.7)
pvapfonagahara = np.exp(169.-543.e3/(8.314*(tvapfo))) 
#print(pvapfonagahara)
#print(tvapfo)
#print(pvapfo)
#axes[3,0].plot(tvapfo+273.,pvapfo*1.e5/1.e9,linestyle='-',color='orange',label='Sublimation curve\nMysen & Kushiro 1988')
#axes[3,0].plot(tvapfo,pvapfonagahara*1.e5/1.e9,linestyle='-',color='green',label='Sublimation curve\nNagahara et al. 1994')
#print(pvapfonagahara)
tt=np.zeros(7)
tt.fill(273.)
tt=tt+np.asarray([1400.,1500.,1600.,1700.,1725.,1760.,1800.])
axes[2,0].plot(tt,np.asarray([8.79E-9,5.98E-8,3.85E-7,2.7E-6,4.21E-6,9.58E-6,1.52E-5])/1.e4,'s',color='orange',label='Nagahara et al. 1994')

# Mysen & Kushiro 1988 vapor curve of forsterite
tvapfo = np.arange(1000)+1000. # in C
pvapfo = np.exp(-77955.0/tvapfo+27.7)
pvapfonagahara = np.exp(169.-543.e3/(8.314*(tvapfo+273.0))) # this makes no sense
#print(pvapfonagahara)
#print(tvapfo)
#print(pvapfo)
#axes[3,0].plot(tvapfo+273.,pvapfo*1.e5/1.e9,linestyle='-',color='orange',label='Sublimation curve\nMysen & Kushiro 1988')
#axes[3,0].plot(tvapfo+273.,pvapfonagahara*1.e5/1.e9,linestyle='-',color='green',label='Sublimation curve\nNagahara et al. 1994')

#Centolanzi and Chapman Tektite vapor curve
tvaptek = np.arange(1400)+1700. # in K
pvaptek = np.exp(-57400.0/tvaptek+18.5)*101325. # in atm to Pa
axes[2,0].plot(tvaptek,pvaptek/1.e9,linestyle='-',color='cyan',label='Vapor curve tektites\nCentolanzi & Chapman 1966')


# don't show a plot in lower right
#axes[2,1].axis("off")

#-------------------------
# density-pressure
ai=2
aj=1
axes[ai,aj].loglog(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(1.e-4,10)
axes[ai,aj].set_xlim(1.e-2,5)
#axes[ai,aj].plot(r1biv,1.E-4,'s',color='black',label='IV 1 bar ANEOS')
#axes[ai,aj].plot(2.968,1.E-4,'s',color='orange',label='MELTS MP Berman')
#axes[ai,aj].plot(2.687,1.E-4,'s',color='orange',label='MELTS MP Lange')

ind=3
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrisale)
axes[ai,aj].loglog(vcarrtmp[:,1]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].loglog(vcarrtmp[:,2]/1.e3,vcarrtmp[:,4],color=col)
axes[ai,aj].plot(vcarrtmp[0,1]/1.e3,vcarrtmp[0,3],'o',color=col)
ind=4
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrgadget)
axes[ai,aj].loglog(vcarrtmp[:,1]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].loglog(vcarrtmp[:,2]/1.e3,vcarrtmp[:,4],color=col)
axes[ai,aj].plot(vcarrtmp[0,1]/1.e3,vcarrtmp[0,3],'o',color=col)
ind=5
col=local_cmaps.parula(colid[ind])
vcarrtmp=np.copy(vcarrcanup)
axes[ai,aj].loglog(vcarrtmp[:,1]/1.e3,vcarrtmp[:,3],color=col,label=labid[ind])
axes[ai,aj].loglog(vcarrtmp[:,2]/1.e3,vcarrtmp[:,4],color=col)
axes[ai,aj].plot(vcarrtmp[0,1]/1.e3,vcarrtmp[0,3],'o',color=col)


axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[0,0].legend(fontsize=sfont-5)
axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
axes[1,1].legend(fontsize=sfont-5)
axes[2,0].legend(fontsize=sfont-5)
axes[2,1].legend(fontsize=sfont-5)

plt.tight_layout(pad=0.4,w_pad=0.5,h_pad=1.0)
plt.savefig('compare-vc.pdf', format='pdf', dpi=1000,transparent=True)
ANEOS Calculated Critical point:
Temperature (K):  6487.2
Density (g/cm$^3$):  0.533792
Pressure (GPa):  0.242898
Sp. Energy (MJ/kg):  19.2063
Sp. Entropy (kJ/kg):  6.7908599999999995
MELT at the triple point T, SIM, SCM, SCV:  2163.0 3.0883000000000003 3.5507 11.7591

ANEOS Calculated 1-bar boiling point:
Sp. Entropy for incipient vaporization IV (kJ/kg):  4.25519 . check 1: 1.0
Sp. Entropy for complete vaporization CV (kJ/kg):  9.003680000000001
Temperature at boiling (K):  3331
Density at boiling (g/cm3):  2.515

ANEOS 1-bar melting point is defined by the input parameters. See plots below.
Triple point estimate:
Sp. Entropy for incipient melting IM at TP (kJ/kg):  3.0883000000000003
Sp. Entropy for complete melting CM at TP (kJ/kg):  3.5507

ANEOS model conditions for shock-induced vaporization:
Impact velocity for IM at TP (km/s): 8.781519783197833
Impact velocity for CM at TP (km/s): 10.18493850996852
Impact velocity for IV at 1 bar (km/s): 12.36914009433962
Shock pressure (GPa) to model IV sp. entropy (kJ/K/kg):  273.0
Shock pressure (GPa) to model CP sp. entropy (kJ/K/kg):  972.0
Shock temperature (K) at model SIV: 6187.0
Shock temperature (K) at model SCP: 38496.0
Shock pressure, Temperature (GPa, K) to model IM sp. entropy (kJ/K/kg):  162.0 3299.0
Shock pressure, Temperature (GPa, K) to model CM sp. entropy (kJ/K/kg):  202.0 4555.0



ANEOS model conditions for shock-induced vaporization on the POROUS Hugoniot: 8 % porous
Shock pressure, Temperature (GPa, K) to model IV sp. entropy (kJ/K/kg):  284.0 6241.0
Shock pressure, Temperature (GPa, K) to model CP sp. entropy (kJ/K/kg):  980.0 38353.0
Impact velocity for IM (km/s): 9.315484647804878
Impact velocity for CM (km/s): 10.656018954343487
Impact velocity for IV (km/s): 12.771140693142804
Shock pressure, Temperature (GPa, K) to model IM sp. entropy (kJ/K/kg):  173.0 3335.0
Shock pressure, Temperature (GPa, K) to model CM sp. entropy (kJ/K/kg):  213.0 4603.0


Melt curve and 1-bar data

The melt curve is OK in P-T space but since the model does not have high pressure solid phases, the densities and entropies are not correct at very high pressures.

For planetary applications, a forsterite EOS is often used to represent the whole mantle. For comparison, the peridotite solidus and liquidus from Fiquet et al. 2010 are shown. The estimates for the mantle solidus and liquidus span a very large range, especially when water is included; see Figure 1 in Andrault et al. 2017.

In [14]:
# plot the melt curve


# Plot aneos vapor curves
sfont = 15
fig, axes = plt.subplots(2, 2, figsize=(14,14))
plt.subplots_adjust(wspace=0.3)

#--------
ai=0
aj=0
axes[0,0].set_xlabel('Pressure (GPa)',size=sfont)
axes[0,0].set_ylabel('Temperature (K)',size=sfont)
axes[0,0].set_title("Melt Curve",size=sfont)
axes[0,0].tick_params(labelsize=sfont)
if imc > -1:
    axes[0,0].plot(mcarr[:,3],mcarr[:,0],color="black",label=eosname)


axes[ai,aj].plot(Mosenfelderdatarr.iloc[:,0].values,Mosenfelderdatarr.iloc[:,1].values,linestyle='-',color='brown',linewidth=1,label='Forsterite Melt Curve\n(Mosenfelder et al. 2007)')

axes[ai,aj].plot(peridotiteliquidusdatarr.iloc[:,0].values,peridotiteliquidusdatarr.iloc[:,1].values,linestyle='-',color='orange',label='Peridotite Liquidus')
axes[ai,aj].plot(peridotitesolidusdatarr.iloc[:,0].values,peridotitesolidusdatarr.iloc[:,1].values,linestyle=':',color='orange',label='Peridotite Solidus\n(Fiquet et al. 2010)')
 
axes[ai,aj].plot(1.e-4,2174.,'d',color='orange',label='Richet et al. 1993')
axes[ai,aj].plot(13.,2550.,'s',color='orange',label='de Koker et al. 2009')
axes[ai,aj].plot(hcarr[:,2],hcarr[:,1],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot

axes[ai,aj].plot(qmdhugdatarr.iloc[:,2].values,qmdhugdatarr.iloc[:,3].values,'^',color='green',label='QMD (Root et al. 2018)')
axes[ai,aj].plot(zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,1].values,color='green',label='Z fit (Root et al. 2018)')
axes[ai,aj].plot(hugdatarr.iloc[:,2].values,hugdatarr.iloc[:,0].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3]) # grid interpolated STP Hugoniot

axes[ai,aj].plot(188,4810,'^',color='orange',label='Luo et al. 2004 Olivine')


axes[0,0].set_ylim(0,8000)
axes[0,0].set_xlim(0,300)

#-----
ai=0
aj=1
axes[0,1].set_ylabel('Pressure (GPa)',size=sfont)
axes[0,1].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[0,1].set_title("Melt Curve",size=sfont)
axes[0,1].tick_params(labelsize=sfont)
if imc > -1:
    axes[0,1].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black",linestyle='--',label='ANEOS liquid')
    axes[0,1].plot(mcarr[:,2]/1.e3,mcarr[:,3],color="black",label='ANEOS solid')



axes[0,1].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) #'ANEOS Hugoniot')
axes[ai,aj].plot(hugdatarr.iloc[:,1].values,hugdatarr.iloc[:,2].values,style1[0],color=style1[1],markersize=style1[2],label=style1[3])#'eos table interpolation')

#axes[0,1].plot(foliqrho0/1.e3,0,'o')
#axes[0,1].plot(foliqrho/1.e3,foliqp/1.e9,'o',label='TA13 Fo Liquid\nHugoniot corrected')
#axes[ai,aj].plot(lowhugdatarr.iloc[:,0].values,lowhugdatarr.iloc[:,1].values,'+',color='green',label='Mosenfelder et al. 2007')

axes[0,1].set_xlim(1.,6.5)
axes[0,1].set_ylim(0,200)

#======
ai=1
aj=0
axes[1,0].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[1,0].set_xlabel('Temperature (K)',size=sfont)
axes[1,0].set_title("1-bar isobar",size=sfont)
axes[1,0].tick_params(labelsize=sfont)

axes[ai,aj].plot(Gilletdatarr.iloc[:,0].values,Gilletdatarr.iloc[:,1].values/1.e3,linestyle='-',color='brown',linewidth=6,label='Gillet et al. 1991')
axes[ai,aj].plot(Gilletdatarr.iloc[:,2].values,Gilletdatarr.iloc[:,3].values/1.e3,linestyle='-',color='orange',linewidth=6,label='Thomas & Asimow 2013')

axes[1,0].set_ylim(0,10)
axes[1,0].set_xlim(0,4000)

it=0
sint = np.interp(1.e-4,np.resize(anparr[it,:],dsize),np.resize(ansarr[it,:],dsize))
    #print(it,sint)
axes[1,0].plot(antarr[0],sint*1.e3,'+',color='blue',label="ANEOS 1 bar")
for tt in antarr:
    sint = np.interp(1.e-4,np.resize(anparr[it,:],dsize),np.resize(ansarr[it,:],dsize))
    #print(it,sint)
    axes[1,0].plot(tt,sint*1.e3,'+',color='blue')
    #print(tt,sint*1.e3)
    it=it+1

#----
ai=1
aj=1

axes[1,1].set_ylabel('Density (g/cm$^3$)',size=sfont)
axes[1,1].set_xlabel('Temperature (K)',size=sfont)
axes[1,1].set_title("1-bar isobar",size=sfont)
axes[1,1].tick_params(labelsize=sfont)
axes[1,1].set_ylim(0,5)
axes[1,1].set_xlim(0,4000)

it=0
dint = np.interp(1.e-4,np.resize(anparr[it,:],dsize),andarr)
axes[1,1].plot(antarr[0],dint,'+',color='blue',label="ANEOS 1 bar")
for tt in antarr:
    dint = np.interp(1.e-4,np.resize(anparr[it,:],dsize),andarr)
    #print(it,dint)
    axes[1,1].plot(tt,dint,'+',color='blue')
    it=it+1

axes[ai,aj].plot(2273.,2.597,'d',color='orange',label='Thomas & Asimow 2013')

axes[ai,aj].plot(1890+273.,2.968,'s',color='orange',label='MELTS MP Berman')
axes[ai,aj].plot(1890+273.,2.687,'o',color='orange',label='MELTS MP Lange')





axes[0,0].legend(fontsize=sfont-5)
axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
axes[1,1].legend(fontsize=sfont-5)

# don't show a plot in lower right
#axes[0,1].axis("off")
Out[14]:
<matplotlib.legend.Legend at 0xb2691da58>

Shock and Release into Standard Window

The following cell uses the measured shock pressure in the forsterite sample and pulls the corresponding density and sp. entropy from the ANEOS STP Hugoniot at 298 K and 3.22 g/cm$^3$ (which has a non-zero initial pressure).

Using this specific entropy, the corresponding ANEOS isentrope is calculated between the Hugoniot and the vapor curve and the intersection with the vapor curve is found.

Then, an ANEOS reshock Hugoniot is calculated from the vapor curve from the EOS table.

Then, this reshock Hugoniot is impedance matched to the quartz window using the observed impact velocity of the liquid layer. This impact velocity should be refined with better timing corrections, especially near the top of the vapor curve.

As of 6/4/2019, the ANEOS model is in the ballpark of the observed shock in the quartz window at lower entropies but very different at higher entropies approaching the critical point. We need to decide if the liquid layer impact velocity needs refinement and/or the density on the dome combined with the reshock Hugoniot.

Improvements: (1) calculate the Reimann integral down the isentrope to try to match the liquid flyer velocity; use this value instead of the observed for self-consistency with the ANEOS thermodynamic path. (2) Plot the PVE isentropes from the shallow release Gruneisen parameter analysis and compare to the ANEOS isentropes. Can be used to improve the ANEOS model in this region of phase space. (3) look at sensitivities to the initial choice of pressure/density/entropy as the true value to input.

In [15]:
def tpx_hugoniot(a,b,c,d,x):
    return a + b*x - c * x *np.exp(-d*x)


# impedance match into quartz from Knudson & Desjarlais PRL 2009
qtzuparr = np.arange(20000)/1000. #km/s
qtzusarr = 6.26+1.2*qtzuparr-2.56*qtzuparr*np.exp(-0.37*qtzuparr)
qtzparr = 2650.0*qtzuparr*qtzusarr/1.e3 #GPa initial density of z-cut quartz assumed
qtzrarr = 1./((1./2.6500)*(1.-qtzuparr/qtzusarr)) # g/cm3

# impedance match into TPX, from Root et al. 2015?
at1=1.795 #parameters
bt1=1.357
ct1=-0.694
dt1=0.273
at2=0.018 #uncertainty
bt2=0.003
ct2=0.027
dt2=0.011
tpxuparr = np.copy(qtzuparr) # km/s
tpxusarr = tpx_hugoniot(at1,bt1,ct1,dt1,tpxuparr) # km/s?
tpxparr = 830.0*tpxuparr*tpxusarr/1.e3 #GPa initial density of z-cut quartz assumed
tpxrarr = 1./((1./0.83)*(1.-tpxuparr/tpxusarr)) # g/cm3


# Z data results with QUARTZ windows
# INPUTS: Fo shock pressure, liquid flyer velocity, quartz shock velocity. All other terms are derived.
# 0- shot number and panel
# 1,2- P in Fo GPa, err
# 3,4- Rho in Fo g/cm3, err
# 5- rhoind
# 6,7- Liq flyer Us km/s, err
# 8,9- Qtz window shock vel km/s, err
# 10,11- Qtz up km/s, err from shock vel
# 12,13- Sshock, err MJ/K/kg
# 14,15- Eshock, err MJ/kg
# 16,17- P in qtz, err from shock vel GPa
# 18,19 - density of Fo liquid flyer, err; from reshock analysis g/cm3
set1 = ['2792AVG',323.5, 5.6, 0.,0.,0.,15.36, 0.19, 13.61, 0.16, 0.,0.,4533.,231.,0.,0.,259.9,12.4,2.28,0.13]
set2 = ['2868AVG',362.7, 2.1, 0.,0.,0.,16.46, 0.30, 14.36, 0.01, 0.,0.,4762.,204.,0.,0.,292.9,11.1,2.23,0.15]
set3 = ['2879NAV',259.0, 2.1, 0.,0.,0.,13.75, 0.25, 12.36, 0.06, 0.,0.,4085.,185.,0.,0.,208.9,9.4,2.20,0.15]
set4 = ['2879SAV',291.6, 2.1, 0.,0.,0.,14.88, 0.79, 12.82, 0.09, 0.,0.,4325.,201.,0.,0.,227.1,10.4,2.19,0.21]
set5 = ['3172AVG',445.0, 2.3, 0.,0.,0.,17.89, 0.18, 14.48, 0.10, 0.,0.,5169.,189.,0.,0.,299.2,9.1,1.83,0.18]

zdata=[set3,set4,set1,set2,set5]

# fostphcarr is the stored ANEOS Hugoniot based at 298 K and 3.22 g/cm3
# Using the ANEOS STP Hugoniot, pull out the density and sp. entropy for the shock pressure of the experiment
for i in range(0,len(zdata)):
#    zdata[i][3]= np.interp(zdata[i][1],fostphcarr[:,2],fostphcarr[:,0]) / 1.e3 # g/cm3 density on the Hugoniot    zdata[i][3]= np.interp(zdata[i][1],fostphcarr[:,2],fostphcarr[:,0]) / 1.e3 # g/cm3 density on the Hugoniot
    zdata[i][3]= np.interp(zdata[i][1],zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,3].values) / 1.e3 # g/cm3 density on the Hugoniot
    tmp = np.interp(zdata[i][3],andarr,np.arange(dsize))
    zdata[i][5] = np.round(tmp) # index of EOS grid closest to the density on the Hugoniot
    #zdata[i][12] = np.interp(zdata[i][1],fostphcarr[:,2],fostphcarr[:,5])/1.e6 # MJ/K/kg entropy in shock
    zdata[i][12] = zdata[i][12]/1.e6 # MJ/K/kg entropy in shock
    zdata[i][13] = zdata[i][13]/1.e6 # MJ/K/kg entropy in shock
    zdata[i][14] = np.interp(zdata[i][1],fostphcarr[:,2],fostphcarr[:,4])/1.e6 # MJ/kg sp. int. energy in shock
    zdata[i][16] = np.interp(zdata[i][8],qtzusarr,qtzparr) #GPa qtz pressure from Us
    zdata[i][10] = np.interp(zdata[i][8],qtzusarr,qtzuparr) #km/s qtz up from Us
    
#print(zdata)
#======================LOTS OF PLOTS============================
# Plot aneos phase boundaries with focus on the vapor curve
sfont = 15
fig, axes = plt.subplots(nrows=3, ncols=2, figsize=(14,18))
plt.subplots_adjust(wspace=0.5)


#-------

# log(density)- log(pressure)
ai=0
aj=0
axes[ai,aj].loglog(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

#axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot
#axes[ai,aj].plot(hcarr[0,0]/1.e3,hcarr[0,2],'o',color=style3[1])
axes[ai,aj].plot(fostphcarr[:,0]/1.e3,fostphcarr[:,2],color='blue',label='ANEOS STP Hugoniot')

allisend = []
allisenp = []
isencrossd = []
isencrossp = []
isencrosst = []
isencrosse = []
# plot isentrope from Z shock point
for i in range(0,len(zdata)):
    # step through the EOS grid: start at density of rho_shock/4 to rho_shock
    isentroped = np.zeros(int(zdata[i][5])-round(int(zdata[i][5])/4.))
    isentropep = np.zeros(int(zdata[i][5])-round(int(zdata[i][5])/4.))
    count=0
    dome=0
    for j in range(round(int(zdata[i][5])/4.),int(zdata[i][5])):
        # interpolate for the pressure with the same entropy at this density
        ptmp = np.interp(zdata[i][12],ansarr[:,j],anparr[:,j])  
        #axes[ai,aj].plot(andarr[j],ptmp,'+',color='purple',markersize=1)
        isentroped[count] = andarr[j]
        isentropep[count] = ptmp
        # figure out if the isentrope has intersected the dome
        # we should be starting 'in the dome'
        if (dome == 0):
            pdome = np.interp(andarr[j]*1.e3,vcarr[:,1],vcarr[:,3]) # pressure on the dome at this density
            if ptmp > pdome:
                # this is the starting point for the reshock Hugoniot
                isencrossd.append(andarr[j-1])
                isencrossp.append(isentropep[count-1])
                crosst = np.interp(andarr[j-2]*1.e3,vcarr[:,1],vcarr[:,0]) # K
                crosse = np.interp(andarr[j-2]*1.e3,vcarr[:,1],vcarr[:,5])/1.e6 # MJ/kg
                #print(crosst,andarr[j-2],crosse)
                isencrosst.append(crosst)
                isencrosse.append(crosse)
                dome=1
        count=count+1

    allisend.append(isentroped)
    allisenp.append(isentropep)
    if i == 0:
        axes[ai,aj].plot(allisend[i],allisenp[i],'-',color='purple',label='Release isentropes')
    else:
        axes[ai,aj].plot(allisend[i],allisenp[i],'-',color='purple')
    #axes[ai,aj].plot(isentroped,isentropep,'-',color='purple')
    # plot starting point
    axes[ai,aj].plot(zdata[i][3],zdata[i][1],'o',color='green')
    # plot isentrope intersection point/starting point for the reshock Hugoniot
    if i == 0:
        axes[ai,aj].plot(isencrossd[i],isencrossp[i],'o',color='purple',label='Release isentropes')
    else:
        axes[ai,aj].plot(isencrossd[i],isencrossp[i],'o',color='purple')


axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].set_ylim(1.e-8,1000)
axes[ai,aj].set_xlim(0.5,8)


#-------

# density- linear(pressure)
ai=0
aj=1
axes[ai,aj].plot(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].plot(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

#axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot
#axes[ai,aj].plot(hcarr[0,0]/1.e3,hcarr[0,2],'o',color=style3[1])
axes[ai,aj].plot(fostphcarr[:,0]/1.e3,fostphcarr[:,2],color='blue',label='ANEOS STP Hugoniot')

for i in range(0,len(zdata)):
    # plot isentrope from Z shock point
    if i == 0:
        axes[ai,aj].plot(allisend[i],allisenp[i],'-',color='purple',label='Release isentropes')
    else:
        axes[ai,aj].plot(allisend[i],allisenp[i],'-',color='purple')
    # plot starting point
    axes[ai,aj].plot(zdata[i][3],zdata[i][1],'o',color='green')
    # plot the intersection of the isentrope with the vapor dome
    axes[ai,aj].plot(isencrossd[i],isencrossp[i],'o',color='purple')
  
axes[ai,aj].plot(zhugdatarr.iloc[:,3].values/1.e3,zhugdatarr.iloc[:,0].values/1.e9,color='green',label='Z fit (Root et al. 2018)')
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].set_ylim(0,500)
axes[ai,aj].set_xlim(0.5,6.75)

#----------------------
ai=1
aj=1
axes[ai,aj].set_xlabel('Particle Velocity (km/s)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[ai,aj].plot(qtzuparr,qtzparr,color='orange',label='Quartz')
axes[ai,aj].plot(tpxuparr,tpxparr,color='purple',label='TPX')
axes[ai,aj].set_xlim(0,20)
axes[ai,aj].set_ylim(0,500)

ai=1
aj=0
axes[ai,aj].loglog(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

#axes[ai,aj].plot(qtzrarr,qtzparr,'-',color='orange')

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].set_ylim(1.e-8,1000)
axes[ai,aj].set_xlim(0.5,8)

ai=1
aj=1
### CALCULATE THE RESHOCK HUGONIOT FOR EACH Z EXPERIMENT
#-----------------------------------------------------------
for i in range(0,len(zdata)):
    # Pull RESHOCK Hugoniot from the ANEOS data cube
    t0  = isencrosst[i] #K
    it0 = int(np.round(np.interp(t0,gridtarr,np.arange(len(gridtarr)))))
    p0  = isencrossp[i] # GPa
    r0  = isencrossd[i] # g/cm3
    ir0 = int(np.round(np.interp(r0,gridrarr,np.arange(len(gridrarr)))))
    e0  = isencrosse[i] # MJ/kg
    s0  = zdata[i][12] # MJ/K/kg
    up0 = 0.
    us0 = 0.
    #print(i,t0,it0,r0,ir0,p0,e0,gridrarr[ir0],andarr[ir0])
    hugoniotfile = open("pullreshockhugoniot.txt","w")  
    # loop over temperature up the table
    # pull out Ehugoniot, interpolate for zero
    hugoniotfile.writelines('Hugoniot \n') 
    hugoniotfile.writelines('Temperature Density   Pressure   IntEnergy  SpEntropy   Part. Vel.  Shock Vel. \n') 
    hugoniotfile.writelines('K ,          g/cm3   ,   GPa   ,     MJ/kg  , MJ/K/kg ,   km/s ,    km/s\n') 
    hugoniotfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (t0,r0,p0,e0,s0,up0,us0))
    for iit in range(it0+5,int(tsize)):
        #for iit in range(it0+1,it0+5):
        # J/kg/1.e6 -> MJ/kg
        ediff = 0.5*(anparr[iit,ir0::]+p0)*(1./r0-1./andarr[ir0::])+e0-(anearr[iit,ir0::]) # MJ/kg
        pnew = np.interp(0.,ediff,anparr[iit,ir0::])
        rnew = np.interp(0.,ediff,andarr[ir0::])
        enew = np.interp(0.,ediff,anearr[iit,ir0::])
        snew = np.interp(0.,ediff,ansarr[iit,ir0::])
        upnew = np.sqrt((pnew-p0)*(1./r0-1./rnew))
        usnew = (1./r0)*np.sqrt((pnew-p0)/(1./r0-1./rnew))
        #print(antarr[iit],rnew,pnew,enew,upnew,usnew)
        #print(ediff)
        hugoniotfile.write("%14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e, %14.6e\n" % (antarr[iit],rnew,pnew,enew,snew,upnew,usnew))
    
    hugoniotfile.close() 
    hugoniotfile = open("pullreshockhugoniot.txt","r")  
    hugreshockdatarr = pd.read_csv(hugoniotfile,skiprows=2)
    hugoniotfile.close() 

    # now plot the reshock Hugoniot flipped to impedance match quartz
    print("\nZ SHOCK AND RELEASE IMPEDANCE MATCH INTO QUARTZ WINDOW FOR EXPERIMENT ",zdata[i][0])
    upflyer=float(zdata[i][6]) # km/s
    type(upflyer)
#    axes[ai,aj].plot(upflyer-hugreshockdatarr.iloc[:,5].values,hugreshockdatarr.iloc[:,2].values,color='crimson',label='Fo flyer '+str(upflyer)+' km/s')
    axes[ai,aj].plot(upflyer-hugreshockdatarr.iloc[:,5].values,hugreshockdatarr.iloc[:,2].values,color='crimson')#,label='Fo flyer '+str(upflyer)+' km/s')
    tmpparr = np.interp(qtzuparr,np.flipud(upflyer-hugreshockdatarr.iloc[:,5].values),np.flipud(hugreshockdatarr.iloc[:,2].values))
    tmpupcross = np.interp(0,qtzparr-tmpparr,qtzuparr)
    tmpuscross = np.interp(tmpupcross,qtzuparr,qtzusarr)
#    tmpusfocross = np.interp(upflyer-tmpupcross,hugreshockdatarr.iloc[10:,5].values,hugreshockdatarr.iloc[10:,6].values)
    tmppcross = np.interp(tmpupcross,qtzuparr,qtzparr)
    # this equation is wrong
    tmprcross = np.interp(tmpupcross,np.flipud(upflyer-hugreshockdatarr.iloc[:,5].values),np.flipud(hugreshockdatarr.iloc[:,1].values))
    tmpusfocross = np.interp(tmpupcross,np.flipud(upflyer-hugreshockdatarr.iloc[:,5].values),np.flipud(hugreshockdatarr.iloc[:,6].values))
    axes[ai,aj].plot(tmpupcross,tmppcross,'o',color='crimson')
    if i ==0:
        axes[ai,aj].plot(zdata[i][10],zdata[i][16],'+',color='green',markersize=10,label='Z data in qtz window')
    else:
        axes[ai,aj].plot(zdata[i][10],zdata[i][16],'+',color='green',markersize=10)
    print(str(upflyer)+' km/s intersection point (Up km/s, Us km/s, P GPa):'+str(tmpupcross)[0:5], str(tmpuscross)[0:5], str(tmppcross)[0:5])
    print('Z data in qtz window (Up km/s, Us km/s, P GPa): ', zdata[i][10],zdata[i][8],zdata[i][16])

    # plot reshock Hugoniot on other panel
    axes[ai,aj-1].plot(hugreshockdatarr.iloc[:,1].values,hugreshockdatarr.iloc[:,2].values,color='crimson',label='Fo flyer '+str(upflyer)+' km/s')
    axes[ai,aj-1].plot(tmprcross,tmppcross,'o',color='crimson')
    axes[ai,aj-1].plot(isencrossd[i],isencrossp[i],'o',color='purple')
    print('fo shock vel, qtz shock vel', tmpusfocross, tmpuscross)
    print('r0,tmprcross, r0*(1-up/us) reshock',r0,tmprcross,r0*tmpusfocross/(tmpusfocross-(upflyer-tmpupcross)),upflyer,tmpusfocross,upflyer-tmpupcross)
    print('entropy kJ/K/kg',zdata[i][12]*1000.)



#-------

# density -- entropy

#    zdata[i][5] = np.round(tmp) # index of EOS grid closest to the density on the Hugoniot
#    zdata[i][12] = np.interp(zdata[i][1],fostphcarr[:,2],fostphcarr[:,5])/1.e6 # MJ/K/kg entropy in shock

ai=2
aj=0
axes[ai,aj].plot(vcarr[:,1]/1.e3,vcarr[:,7]/1.e3,color="black",label=eosname)
#axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,7]/1.e3,'ko')
#if imc > -1:
#    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
#    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

#axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot
#axes[ai,aj].plot(hcarr[0,0]/1.e3,hcarr[0,2],'o',color=style3[1])
axes[ai,aj].plot(fostphcarr[:,0]/1.e3,fostphcarr[:,5]/1.e3,color='blue',label='ANEOS STP Hugoniot')
axes[ai,aj].plot(zhugdatarr.iloc[:,3].values/1.e3,zhugdatarr.iloc[:,2].values/1.e3,color='green',label='Z Hugoniot')


for i in range(0,len(zdata)):
    if i == 0:
        axes[ai,aj].plot(zdata[i][3] ,zdata[i][12]*1.e3,'o',color='green',label='Start of isentrope')
    else:
        axes[ai,aj].plot(zdata[i][3] ,zdata[i][12]*1.e3,'o',color='green')
    if i == 0:
        axes[ai,aj].plot(isencrossd[i],zdata[i][12]*1.e3,'o',color='purple',label='Intersection with dome')
        #axes[ai,aj].plot(zdata[i][18],zdata[i][12],'+',color='green',label='Fo data')
        axes[ai,aj].errorbar(zdata[i][18],zdata[i][12]*1.e3, yerr=zdata[i][13]*1.e3, xerr=zdata[i][19],fmt='o', color='g', ecolor='g', capthick=2,label='Fo data')
    else:
        axes[ai,aj].plot(isencrossd[i],zdata[i][12]*1.e3,'o',color='purple')
        #axes[ai,aj].plot(zdata[i][18],zdata[i][12]*1.e3,'+',color='green')
        axes[ai,aj].errorbar(zdata[i][18],zdata[i][12]*1.e3, yerr=zdata[i][13]*1.e3, xerr=zdata[i][19],fmt='o', color='g', ecolor='g', capthick=2)




axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].set_ylim(3,7)
axes[ai,aj].set_xlim(0,8)


#-------

#-------

# temperature -- entropy

#    zdata[i][5] = np.round(tmp) # index of EOS grid closest to the density on the Hugoniot
#    zdata[i][12] = np.interp(zdata[i][1],fostphcarr[:,2],fostphcarr[:,5])/1.e6 # MJ/K/kg entropy in shock

ai=2
aj=1
axes[ai,aj].plot(vcarr[:,0],vcarr[:,7]/1.e3,color="black",label=eosname)
#axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,0],vcarr[0,7]/1.e3,'ko')
#if imc > -1:
#    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
#    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

#axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],style3[0],color=style3[1],markersize=style3[2],label=style3[3]) # ANEOS Hugoniot
#axes[ai,aj].plot(hcarr[0,0]/1.e3,hcarr[0,2],'o',color=style3[1])
#axes[ai,aj].plot(fostphcarr[:,0]/1.e3,fostphcarr[:,5]/1.e3,color='blue',label='ANEOS STP Hugoniot')
#axes[ai,aj].plot(zhugdatarr.iloc[:,3].values/1.e3,zhugdatarr.iloc[:,2].values/1.e3,color='green',label='Z Hugoniot')

ztemprel = [5516.,5040.,5177.] #K
ztemprelerr = [256.,176.8,203] #K
zpresrel = [496.,450.7,517.3] # GPa
zentrel = np.interp(zpresrel,zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,2].values) / 1.e3 # Sp. Ent kJ/kg/K
zentrelerr = np.interp(zpresrel,zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,6].values) / 1.e3 # Sp. Ent kJ/kg/K

axes[ai,aj].errorbar(ztemprel,zentrel,yerr=zentrelerr,xerr=ztemprelerr,fmt='o', color='g', ecolor='g', capthick=2,label='Fo Release Temp. (min)')


axes[ai,aj].set_xlabel('Temperature (K)',size=sfont)
axes[ai,aj].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)
axes[ai,aj].set_ylim(3,8)
axes[ai,aj].set_xlim(3000,7000)


#-------

#-------------------------------------------------------------
# don't show a plot in lower right
#axes[2,1].axis("off")

axes[0,0].legend(fontsize=sfont-5)
axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
axes[1,1].legend(fontsize=sfont-5)
axes[2,0].legend(fontsize=sfont-5)
axes[2,1].legend(fontsize=sfont-5)
Z SHOCK AND RELEASE IMPEDANCE MATCH INTO QUARTZ WINDOW FOR EXPERIMENT  2879NAV
13.75 km/s intersection point (Up km/s, Us km/s, P GPa):6.843 13.07 237.2
Z data in qtz window (Up km/s, Us km/s, P GPa):  6.370333574634778 12.36 208.65390680431628
fo shock vel, qtz shock vel 13.378811997952182 13.079568071346644
r0,tmprcross, r0*(1-up/us) reshock 2.567105 5.306409843871458 5.30640926255018 13.75 13.378811997952182 6.906485142880804
entropy kJ/K/kg 4.085

Z SHOCK AND RELEASE IMPEDANCE MATCH INTO QUARTZ WINDOW FOR EXPERIMENT  2879SAV
14.88 km/s intersection point (Up km/s, Us km/s, P GPa):7.278 13.73 264.8
Z data in qtz window (Up km/s, Us km/s, P GPa):  6.672199309375175 12.82 226.6746277795475
fo shock vel, qtz shock vel 14.117086643188143 13.733259571953711
r0,tmprcross, r0*(1-up/us) reshock 2.468421 5.348216451055146 5.348218504533714 14.88 14.117086643188143 7.60147530469754
entropy kJ/K/kg 4.325

Z SHOCK AND RELEASE IMPEDANCE MATCH INTO QUARTZ WINDOW FOR EXPERIMENT  2792AVG
15.36 km/s intersection point (Up km/s, Us km/s, P GPa):7.391 13.90 272.2
Z data in qtz window (Up km/s, Us km/s, P GPa):  7.196084336938899 13.61 259.53757604454523
fo shock vel, qtz shock vel 14.416624853505121 13.901219799219861
r0,tmprcross, r0*(1-up/us) reshock 2.369737 5.298358079184229 5.298479088056899 15.36 14.416624853505121 7.968810534962737
entropy kJ/K/kg 4.5329999999999995

Z SHOCK AND RELEASE IMPEDANCE MATCH INTO QUARTZ WINDOW FOR EXPERIMENT  2868AVG
16.46 km/s intersection point (Up km/s, Us km/s, P GPa):7.739 14.41 295.6
Z data in qtz window (Up km/s, Us km/s, P GPa):  7.700928087648233 14.36 293.0511177080721
fo shock vel, qtz shock vel 15.148958465383584 14.416964833437515
r0,tmprcross, r0*(1-up/us) reshock 2.238158 5.274193167943285 5.274242600473029 16.46 15.148958465383584 8.720402718265486
entropy kJ/K/kg 4.762

Z SHOCK AND RELEASE IMPEDANCE MATCH INTO QUARTZ WINDOW FOR EXPERIMENT  3172AVG
17.89 km/s intersection point (Up km/s, Us km/s, P GPa):8.012 14.81 314.6
Z data in qtz window (Up km/s, Us km/s, P GPa):  7.7824425063578335 14.48 298.62788481510853
fo shock vel, qtz shock vel 16.123808922612337 14.817012720247217
r0,tmprcross, r0*(1-up/us) reshock 1.975 5.097980993580967 5.098124510897257 17.89 16.123808922612337 9.877487838438814
entropy kJ/K/kg 5.169
Out[15]:
<matplotlib.legend.Legend at 0xb25c20e80>
In [16]:
ztemprel = [5516.,5040.,5177.] #K
ztemprelerr = [256.,176.8,203] #K
zpresrel = [496.,450.7,517.3] # GPa
zentrel = np.interp(zpresrel,zhugdatarr.iloc[:,0].values/1.e9,zhugdatarr.iloc[:,2].values) / 1.e3 # Sp. Ent kJ/kg/K
print(zentrel)
[5.39772482 5.20536605 5.48190157]

Gamma function and isotherms

The Gruneisen parameter has been determined experimentally from shock wave data (Thomas & Asimow 2013; Davies et al. in prep.). \begin{equation} \gamma = \frac{1}{\rho}\frac{(P-P_{\rm ref})}{(E-E_{\rm ref})} \bigg\rvert _V \end{equation}

The ANEOS Gruneisen model is split into two parts. For $\rho \ge \rho_{0}$, \begin{equation} \gamma = \left( \frac{\gamma_0 \rho_0}{\rho} + C_{24} \left( 1-\frac{\rho_0}{\rho} \right)^2 \right) (1-C_{60}) + \left( \gamma_0 + (C_{24}-\gamma_0) \left( 1- \frac{\rho_0}{\rho} \right)^2 \right) C_{60}. \end{equation} For $\rho < \rho_{0}$, \begin{equation} \gamma = C_{16} \rho^2 + C_{17}\rho + 1 + C_{61}. \end{equation}

$C_{16}$ and $C_{17}$ are calculated so that $\gamma$ and $d \gamma / d \rho$ are continuous at $\rho=\rho_0$.

In [17]:
# plot the gamma and isotherms

# ANEOS Formulation for Gamma
# THESE VALUES ARE READ FROM THE ANEOS.INPUT FILE ABOVE
#rho0=6.98 # g/cm3
#gamma0=2.2 # dimless
#C24 = 1.  # dimless
#C60 = 0. #dimless
print('Values from the ANEOS.INPUT file:')
print('rho0 (g/cm$^3$)=',rho0)
print('gamma0=',gamma0)
print('theta0=',theta0)
print('C24=',C24)
print('C60=',C60)
print('C61=',C61)
print('beta=',betagamma)
#C60=0.5
#C61=0.
theta0=abs(theta0)
rhoarr = (1+np.arange(100))/100.*rho0*10.
gammaarr = (gamma0*rho0/rhoarr)+C24*np.power(1.0-rho0/rhoarr,2.)*(1.-C60)+(gamma0 + (C24-gamma0)*np.power(1.-rho0/rhoarr,2.))*C60
s3 = C61+1.
C14 = theta0 * np.exp(1.5*s3-(2.-0.5*C60)*gamma0)/(np.power(rho0,s3))
C16 = (s3-(2.-C60)*gamma0)/(rho0*rho0)
C17 = ((3.-C60)*gamma0-2.*s3)/rho0
gammaarrlow = C16*rhoarr*rhoarr+C17*rhoarr+s3
#thetaarr = theta0*np.power((rhoarr/rho0),C24)*np.exp(gamma0*(1-rho0/rhoarr)-0.5*C24*(3.-4.*rho0/rhoarr+rho0*rho0/np.power(rhoarr,2)))
thetaarr = theta0*np.exp((1.-C60)*(1.-rho0/rhoarr)*gamma0-0.5*(rho0/rhoarr)*(3.-(rho0/rhoarr)*(4-(rho0/rhoarr))))*np.power((rhoarr/rho0),C24)
#np.power((rhoarr/rho0),C24)*np.exp(gamma0*(1-rho0/rhoarr)-0.5*C24*(3.-4.*rho0/rhoarr+rho0*rho0/np.power(rhoarr,2)))
thetalowarr = C14*np.exp(rhoarr*(C17+0.5*C16*rhoarr))*np.power(rhoarr,s3)


C24t=C24#2./3.
C61t=C61
rhot = 7.
gammat=.9
#thetat=np.interp(rhot,rhoarr,thetaarr)
gammatarr = (gammat*rhot/rhoarr)+C24t*np.power(1.0-rhot/rhoarr,2.)*(1.-C60)+(gammat + (C24t-gamma0)*np.power(1.-rhot/rhoarr,2.))*C60
s3 = C61t+1.
thetat=theta0
C14t = theta0 * np.exp(-(rho0/rhot)*(3*gammat-2*s3)-0.5*(rho0/rhot)*(rho0/rhot)*(s3-2*gammat))/(np.power(rho0,s3))
C16 = (s3-(2.-C60)*gammat)/(rhot*rhot)
C17 = ((3.-C60)*gammat-2.*s3)/rhot
gammatarrlow = C16*rhoarr*rhoarr+C17*rhoarr+1+C61t
#thetatarr = thetat*np.power((rhoarr/rhot),C24t)*np.exp(gamma0*(1-rhot/rhoarr)-0.5*C24t*(3.-4.*rhot/rhoarr+rhot*rhot/np.power(rhoarr,2)))
#thetatlowarr = C14*np.exp(rhoarr*(C17+0.5*C16*rhoarr))*np.power(rhoarr,C61+1.)
theta1 =C14t*np.exp(rhot*(C17+0.5*rhot*C16))*np.power(rhot,s3)
C14part2 = theta1*np.exp(gammat-2.*C24t+C24t/2.)/np.power(rhot,C24t)
thetatarr = C14part2*np.power(rhoarr,C24t)*np.exp(-gammat*(rhot/rhoarr)+2.*C24t*(rhot/rhoarr)-0.5*C24t*np.power(rhot/rhoarr,2.))
thetatlowarr = C14t*np.exp(rhoarr*(C17+0.5*C16*rhoarr))*np.power(rhoarr,s3)


ginf = C24
g00=gamma0
beta = betagamma
if beta == 0:
    beta=1
gee = .9
rsig=1.2
ree=5.2
krausgammaarr = ginf+(g00-ginf)*np.power((rho0/rhoarr),beta) + gee*np.exp(-np.power((rhoarr-ree)/rsig,2))
frho0 = (ginf-gee)*np.log(rho0)-(gamma0-ginf)/beta - gee*ree*ree/rsig/rsig*np.log(rho0) + gee*rho0*rho0/2./rsig/rsig - 2.*gee*ree*rho0/rsig/rsig
crho0 = frho0-np.log(theta0)
fff = ginf*np.log(rhoarr)-(gamma0-ginf)/beta*np.power(rho0/rhoarr,beta)*gee*np.log(rhoarr)-gee/rsig/rsig*(ree*ree*np.log(rhoarr)+rhoarr*rhoarr/2.-2.*ree*rhoarr)
#krausthetaarr = np.exp(fff)/np.exp(crho0)

ginf = C24
g00=.8
beta = 0.1
k2gammaarr = ginf+(g00-ginf)*np.power((rho0/rhoarr),beta)#- rhoarr*rhoarr + np.power((rhoarr+5.)/6.,2)
krausthetaarr = np.zeros(100)
kraus2thetaarr = np.zeros(100)
kraus2thetaarr=theta0*np.exp((g00-ginf)/beta-ginf*np.log(rho0))*np.exp(ginf*np.log(rhoarr)-(g00-ginf)*np.power(rho0,beta)/beta/np.power(rhoarr,beta))
for i in range(1,100):
    tmp = np.trapz(krausgammaarr[0:i]/rhoarr[0:i],rhoarr[0:i])
    krausthetaarr[i]=theta0/4.*np.exp(tmp)

#-------- plots
sfont = 15
fig, axes = plt.subplots(2, 2, figsize=(14,14))
plt.subplots_adjust(wspace=0.3)


# -----
ai=0
aj=0
axes[ai,aj].plot(rhoarr,gammaarr,label="ANEOS-high",color='black')
axes[ai,aj].plot(rhoarr,gammaarrlow,label="ANEOS-low",color='black',ls='--')
#axes[ai,aj].plot(rhoarr,krausgammaarr,label="Kraus",color='blue')
#axes[ai,aj].plot(rhoarr,k2gammaarr,label="Kraus2",color='green')

axes[ai,aj].plot(rho0,gamma0,'+',label="ANEOS Gamma0",color='black')

#axes[ai,aj].plot(rhoarr,gammatarr,label="ANEOS Gammat",color='red')
#axes[ai,aj].plot(rhoarr,gammatarrlow,label="ANEOS gammat-low",color='red')

axes[ai,aj].set_ylim(0,4)
axes[ai,aj].set_xlim(0,10)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Gamma (-)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

# solid forsterite at STP
axes[ai,aj].plot([3.22],[1.29],'s',color='red',label='Fo solid STP')

# Thomas and Asimow 2013 liquid forsterite shock data
gamma_0=0.396
q=-2.02
q_u=1.03
Rho_0=2597. # kg/m^3
asi_rhot = np.array([3739.79122056, 3335.90237636,4691.02371542 ,4088.40354767, 4347.15217391 ,4681.1865942 ])
##asi_rhot=np.array([3340.0, 3740.0, 4100.0, 4680.0, 5290.0, 5420.0]) # BAD TABULATED VALUES
asi_gammat=gamma_0*np.power(Rho_0/asi_rhot,q)

asi_rho = np.append([2597.],asi_rhot)/1.e3
asi_gamma = np.append([0.396],asi_gammat)

#print(asi_rho)
#print(asi_gamma)
#[3739.79122056 3335.90237636 4691.02371542 4088.40354767 4347.15217391 4681.1865942 ]
#[0.82720568 0.65667847 1.30744208 0.99037675 1.12107749 1.30190973]

# Erik's error bars monte carlo'd for the asimow data
#gamma [ 0.82271901  0.65485213  1.29584059  0.97276836  1.11171104  1.29195917]
asi_gamma_sig_low=np.asarray([0., 0.25715384 , 0.14948592 , 0.5898531,   0.36154228 , 0.45607297 , 0.58790934])
asi_gamma_sig_high=np.asarray([0., 0.37855329,  0.19525818 , 1.09577441,  0.6137275 ,  0.78965792 , 1.08676142])

#axes[ai,aj].plot(dgarr,ggarr,'bs',label='Pyrolite')
axes[ai,aj].plot(asi_rho,asi_gamma,'o',color='orange',label='Forsterite liq. (TA13 corrected)')
for i in range(0,len(asi_gamma)):
    #print(i,[asi_rho[i],asi_rho[i]])
    #print(asi_gamma[i]-asi_gamma_sig_low[i],asi_gamma[i]-asi_gamma_sig_high[i])
    axes[ai,aj].plot([asi_rho[i],asi_rho[i]],[asi_gamma[i]-asi_gamma_sig_low[i],asi_gamma[i]+asi_gamma_sig_high[i]],linestyle='-',color='orange')
#axes[ai,aj].errorbar(asi_rho/1.e3,asi_gamma,asi_gamma_sig,np.zeros(7),'+',color='orange')

# Erik Davies forsterite gamma release data table from May, 2019
#file2="Gamma_Release_Data.csv"
#table2 = pd.read_csv(file2,nrows=11)
#print("Erik Davies Forsterite gamma release data")
#print(table2)
#ek_rho = table2.iloc[:,2].values
#ek_gamma = table2.iloc[:,0].values
#ek_rho_e = table2.iloc[:,3].values
#ek_gamma_e = table2.iloc[:,1].values

#ax2.plot(ek_rho/1.e3,ek_gamma,'x',label='Forsterite (EK)')
#axes[ai,aj].errorbar(ek_rho/1.e3,ek_gamma,ek_rho_e/1.e3,ek_gamma_e,'g+',label='Forsterite (EJD)')

axes[ai,aj].errorbar(SR_rho/1.e3,SR_gamma,yerr=SR_gamma_e, xerr=SR_rho_e/1.e3, fmt='g+', label ='Forsterite liq. Z data (Davies)')


# -----
ai=0
aj=1
axes[ai,aj].plot(rhoarr,thetaarr,label="ANEOS Theta-high",color='black')
axes[ai,aj].plot(rhoarr,thetalowarr,label="ANEOS Theta-low",color='black',ls='--')
axes[ai,aj].plot(rho0,theta0,'+',label="Theta0",color='black')
#axes[ai,aj].plot(rhoarr,gammaarrlow,label="ANEOS-low",color='red')
#axes[ai,aj].plot(rhoarr,krausgammaarr,label="Kraus",color='blue')
#axes[ai,aj].plot(highrhoarr,highgammaarr,label="ANEOS-high")

#axes[ai,aj].plot(rhoarr,thetatarr,label="ANEOS Thetat",color='red',ls='--')
#axes[ai,aj].plot(rhoarr,thetatlowarr,label="ANEOS Thetat low",color='red')
#axes[ai,aj].plot(rhoarr,krausthetaarr,label="Kraus theta",color='blue')
#axes[ai,aj].plot(rhoarr,kraus2thetaarr,label="Kraus theta2",color='green')

#axes[ai,aj].plot(rhot,theta1,'+',label="cross",color='red')

axes[ai,aj].set_ylim(0,5000)
axes[ai,aj].set_xlim(0,10)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Theta (K)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

# -----
ai=1
aj=0
axes[ai,aj].plot(rhoarr,gammaarr/rhoarr,label="ANEOS-high Gamma/rho",color='black')
axes[ai,aj].plot(rhoarr,gammaarrlow/rhoarr,label="ANEOS-low Gamma/rho",color='black',ls='--')
#axes[ai,aj].plot(rhoarr,krausgammaarr/rhoarr,label="Kraus/rho",color='blue')
#axes[ai,aj].plot(rhoarr,k2gammaarr/rhoarr,label="Kraus2/rho",color='green')

axes[ai,aj].plot(rho0,gamma0/rho0,'+',label="ANEOS Gamma0",color='black')

#axes[ai,aj].plot(rhoarr,gammatarr/rhoarr,label="ANEOS Gammat",color='red',ls='--')
#axes[ai,aj].plot(rhoarr,gammatarrlow/rhoarr,label="ANEOS gammat-low",color='red')

axes[ai,aj].set_ylim(0,4)
axes[ai,aj].set_xlim(0,10)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Gamma/rho (cm$^3$/g)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

axes[1,1].axis("off")

axes[0,0].legend(fontsize=sfont-5)
axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
Values from the ANEOS.INPUT file:
rho0 (g/cm$^3$)= 2.9
gamma0= 0.75
theta0= -1200.0
C24= 1.8333333333333333
C60= 0.0
C61= -0.8
beta= 0.0
Out[17]:
<matplotlib.legend.Legend at 0xb25755e48>
In [18]:
sfont = 15
fig, axes = plt.subplots(4, 2, figsize=(14,28))
plt.subplots_adjust(wspace=0.3)


#-----------------------------
# Pick isotherms and set color scale
ixtemparr = [298.,1000.,2050.,2300.,5000.,8000.,20000.]
# set color scale same for all plots
tcolmin=0.
tcolmax=20000.

# find the index closest to the selected temperatures -- no interpolation
ixindarr=np.zeros(len(ixtemparr))
ixlabelarr = []
for i in np.arange(len(ixtemparr)):
    tmpi=int(np.round(np.interp(ixtemparr[i],antarr,np.arange(len(antarr)))))
    #print(tmpi,antarr[tmpi])
    ixindarr[i] = tmpi
    ixlabelarr.append(str(ixtemparr[i])+' K')

#-----------------------------
# pressure-density zoom

ai=0
aj=0
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(anparr[int(ixindarr[i]),:],dsize),c=col,linestyle='-',label=ixlabelarr[i])

axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],color="red",label='ANEOS Hugoniot')

#axes[0,1].set_ylim(0,1000)
#axes[0,1].set_xlim(2,10)
axes[ai,aj].set_ylim(-10,40)
axes[ai,aj].set_xlim(1,4)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].set_title("Isotherms",size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#-----------------------------
# pressure-density large range

ai=0
aj=1
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(anparr[int(ixindarr[i]),:],dsize),c=col,linestyle='-',label=ixlabelarr[i])

axes[ai,aj].plot(hcarr[:,0]/1.e3,hcarr[:,2],color="red",label='ANEOS Hugoniot')

axes[ai,aj].set_ylim(-10,1000)
axes[ai,aj].set_xlim(1,10)
#axes[ai,aj].set_ylim(-10,40)
#axes[ai,aj].set_xlim(2,4)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].set_title("Isotherms",size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#-----------------------
# plot sound speed along isotherms
ai=1
aj=0
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(anparr[int(ixindarr[i]),:],dsize),np.resize(ancarr[int(ixindarr[i]),:],dsize)/1.e5,c=col,linestyle='-',label=ixlabelarr[i])

#axes[ai,aj].plot(hcarr[:,4]/1.e6,hcarr[:,2],color="red",label='ANEOS Hugoniot')
axes[ai,aj].plot(1.e-4,2.674,'d',color='orange',label='Thomas & Asimow 2013 2273 K')

# plot sound speed in forsterite liquid vs. pressure
#csrho0 = 2597.0 # kg/m3
#csK0   = 18.57e9 # Pa
#csKp   = 5.58 # unitless
#csparr = np.arange(40)*1.e9 # pressure in Pa
#csvarr = (1./csrho0)*np.power((1-csparr*(csKp/csK0)),(-1./csKp)) # kg/m3
#csrarr = 1./csvarr
#cskarr = csK0+csKp*csparr # Pa
#cscarr = np.power(cskarr/csrarr,0.5) # m/s
#print(csparr)
#print(csvarr)
#print(csrarr)
#print(cscarr)
#axes[ai,aj].plot(csparr/1.e9,cscarr/1000.,linestyle='-',color='orange')

axes[ai,aj].set_ylim(0,10)
axes[ai,aj].set_xlim(-10,40)

axes[ai,aj].set_ylabel('Bulk Sound Speed (km/s)',size=sfont)
axes[ai,aj].set_xlabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


#-----------------------
# plot sound speed along isotherms
ai=1
aj=1
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(anparr[int(ixindarr[i]),:],dsize),np.resize(ancarr[int(ixindarr[i]),:],dsize)/1.e5,c=col,linestyle='-',label=ixlabelarr[i])

#axes[ai,aj].plot(hcarr[:,4]/1.e6,hcarr[:,2],color="red",label='ANEOS Hugoniot')
axes[ai,aj].plot(1.e-4,2.674,'d',color='orange',label='Thomas & Asimow 2013 2273 K')

axes[ai,aj].set_ylim(0,20)
axes[ai,aj].set_xlim(0,700)

axes[ai,aj].set_ylabel('Bulk Sound Speed (km/s)',size=sfont)
axes[ai,aj].set_xlabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#-----------------------
# plot energy in isotherms
ai=2
aj=0
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(anearr[int(ixindarr[i]),:],dsize),np.resize(anparr[int(ixindarr[i]),:],dsize),c=col,linestyle='-',label=ixlabelarr[i])

axes[ai,aj].plot(hcarr[:,4]/1.e6,hcarr[:,2],color="red",label='ANEOS Hugoniot')

axes[ai,aj].set_ylim(-10,60)
axes[ai,aj].set_xlim(0,30)

axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#------------------------------
# plot energy in isotherms
ai=2
aj=1
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(anearr[int(ixindarr[i]),:],dsize),np.resize(anparr[int(ixindarr[i]),:],dsize),c=col,linestyle='-',label=ixlabelarr[i])

axes[ai,aj].plot(hcarr[:,4]/1.e6,hcarr[:,2],color="red",label='ANEOS Hugoniot')

axes[ai,aj].set_ylim(-10,1000)
axes[ai,aj].set_xlim(0,40)

axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)




#-----------------------
ai=3
aj=0
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].semilogy(np.resize(anparr[int(ixindarr[i]),:],dsize),np.resize(ancvarr[int(ixindarr[i]),:],dsize)*1000.,c=col,linestyle='-',label=ixlabelarr[i])

axes[ai,aj].plot(1.e-4,1.73736,'^',color='orange',label='1 bar 2273 K liquid Cv\n(TA2013)')
axes[ai,aj].plot(1.e-4,0.838,'s',color='orange',label='1 bar 300 K Cv\n(Gillet)')
axes[ai,aj].set_ylim(1.e-1,10.)
axes[ai,aj].set_xlim(0,60)

axes[ai,aj].set_ylabel('Specific heat capacity Cv (kJ/K/kg)',size=sfont)
axes[ai,aj].set_xlabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#-----------------------
ai=3
aj=1
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].loglog(np.resize(anparr[int(ixindarr[i]),:],dsize),np.resize(ancvarr[int(ixindarr[i]),:],dsize)*1000.,c=col,linestyle='-',label=ixlabelarr[i])

axes[ai,aj].plot(1.e-4,1.73736,'^',color='orange',label='1 bar 2273 K liquid Cv\n(TA2013)')
axes[ai,aj].plot(1.e-4,0.838,'s',color='orange',label='1 bar 300 K Cv\n(Gillet)')

axes[ai,aj].set_ylim(1.e-1,20.)
axes[ai,aj].set_xlim(1.e-10,1000000)

axes[ai,aj].set_ylabel('Specific heat capacity Cv (kJ/K/kg)',size=sfont)
axes[ai,aj].set_xlabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#--------------------------------
axes[0,0].legend(fontsize=sfont-5)
axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
axes[1,1].legend(fontsize=sfont-5)
axes[2,0].legend(fontsize=sfont-5)
axes[2,1].legend(fontsize=sfont-5)
axes[3,0].legend(fontsize=sfont-5)
axes[3,1].legend(fontsize=sfont-5)
Out[18]:
<matplotlib.legend.Legend at 0xb276a66a0>
In [19]:
sfont = 15
fig, axes = plt.subplots(2, 2, figsize=(14,14))
plt.subplots_adjust(wspace=0.3)


#-----------------------------
# Pick isotherms and set color scale
ixtemparr = [500.,2250.,6500.,7000.,7500.,8000.,25000.]
# set color scale same for all plots
tcolmin=2000.
tcolmax=8500.

# find the index closest to the selected temperatures -- no interpolation
ixindarr=np.zeros(len(ixtemparr))
ixlabelarr = []
for i in np.arange(len(ixtemparr)):
    tmpi=int(np.round(np.interp(ixtemparr[i],antarr,np.arange(len(antarr)))))
    #print(tmpi,antarr[tmpi])
    ixindarr[i] = tmpi
    ixlabelarr.append(str(ixtemparr[i])+' K')

#-----------------------------
# pressure-density zoom

ai=0
aj=0
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(anparr[int(ixindarr[i]),:],dsize),c=col,linestyle='-',label=ixlabelarr[i])

for i in np.arange(len(QMD_t)):
    if (QMD_t[i] > 6490):
        icolscale = (QMD_t[i]-tcolmin)/(tcolmax-tcolmin)
        col=local_cmaps.parula(icolscale)
        axes[ai,aj].plot(QMD_r[i],QMD_p[i],'s',c=col)

axes[ai,aj].set_ylim(-1,5)
axes[ai,aj].set_xlim(0.,2.)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].set_title("QMD Isotherms",size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)



#-----------------------
ai=0
aj=1
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(ancvarr[int(ixindarr[i]),:],dsize)*1000.,c=col,linestyle='-',label=ixlabelarr[i])

for i in np.arange(len(QMD_t)):
    if (QMD_t[i] > 7900):
        #icolscale = (QMD_t[i]-tcolmin)/(tcolmax-tcolmin)
        #col=local_cmaps.parula(icolscale)
        QMD_cv1 = (QMD_e[i]-QMD_e[i-12])/500./1000. #kJ/K/kg
        QMD_cv2 = (QMD_e[i]-QMD_e[i-24])/1000./1000.
        axes[ai,aj].plot(QMD_r[i],QMD_cv1,'o',c='green')
        axes[ai,aj].plot(QMD_r[i],QMD_cv2,'+',c='darkgreen')
        #print(i,QMD_r[i],QMD_t[i],QMD_t[i-12],QMD_cv1,QMD_cv2)

        
axes[ai,aj].plot(QMDH_r,QMDH_cv,'s',color='green',label='QMD Hugoniot')
#print(QMDH_r,QMDH_cv)
axes[ai,aj].plot(2.597,1.73736,'^',color='orange',label='1 bar 2273 K liquid Cv\n(TA2013)')
axes[ai,aj].plot(1.e-4,0.838,'s',color='orange',label='1 bar 300 K Cv\n(Gillet)')
axes[ai,aj].set_ylim(1.,5.)
axes[ai,aj].set_xlim(0,10)

axes[ai,aj].set_ylabel('Specific heat capacity Cv (kJ/K/kg)',size=sfont)
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_title("QMD Cv",size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#-----------------------
ai=1
aj=0
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].loglog(np.resize(anparr[int(ixindarr[i]),:],dsize),np.resize(ancvarr[int(ixindarr[i]),:],dsize)*1000.,c=col,linestyle='-',label=ixlabelarr[i])

for i in np.arange(len(QMD_t)):
    if (QMD_t[i] > 7900):
        #icolscale = (QMD_t[i]-tcolmin)/(tcolmax-tcolmin)
        #col=local_cmaps.parula(icolscale)
        QMD_cv1 = (QMD_e[i]-QMD_e[i-12])/500./1000. #kJ/K/kg
        QMD_cv2 = (QMD_e[i]-QMD_e[i-24])/1000./1000.
        axes[ai,aj].plot(QMD_p[i],QMD_cv1,'o',c='green')
        axes[ai,aj].plot(QMD_p[i],QMD_cv2,'+',c='darkgreen')
        #print(i,QMD_p[i],QMD_t[i],QMD_t[i-12],QMD_cv1,QMD_cv2)
        
    
axes[ai,aj].plot(1.e-4,1.73736,'^',color='orange',label='1 bar 2273 K liquid Cv\n(TA2013)')
axes[ai,aj].plot(1.e-4,0.838,'s',color='orange',label='1 bar 300 K Cv\n(Gillet)')

axes[ai,aj].set_ylim(1.e-1,20.)
axes[ai,aj].set_xlim(1.e-10,1000000)

axes[ai,aj].set_ylabel('Specific heat capacity Cv (kJ/K/kg)',size=sfont)
axes[ai,aj].set_xlabel('Pressure (GPa)',size=sfont)
axes[ai,aj].set_title("QMD Cv",size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


#-----------------------
ai=1
aj=1
for i in np.arange(len(ixtemparr)):
    icolscale = (ixtemparr[i]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    tmp = np.resize(ancvarr[int(ixindarr[i]),:],dsize)
    axes[ai,aj].plot(andarr,tmp*1000.*1000./7/8.314*0.14,c=col,linestyle='-',label=ixlabelarr[i])

#    axes[ai,aj].plot(andarr,np.resize(ancvarr[int(ixindarr[i]),:],dsize)*1000./7/8.314*0.140,c=col,linestyle='-',label=ixlabelarr[i])
#    print(ancvarr[int(ixindarr[i]),400:410]*1000.)

    
for i in np.arange(len(QMD_t)):
    if (QMD_t[i] > 7900):
        #icolscale = (QMD_t[i]-tcolmin)/(tcolmax-tcolmin)
        #col=local_cmaps.parula(icolscale)
        QMD_cv1 = (QMD_e[i]-QMD_e[i-12])/500./7/8.314*0.140 #kJ/K/kg
        QMD_cv2 = (QMD_e[i]-QMD_e[i-24])/1000./7/8.314*0.140
        axes[ai,aj].plot(QMD_r[i],QMD_cv1,'o',c='green')
        axes[ai,aj].plot(QMD_r[i],QMD_cv2,'+',c='darkgreen')
        #print(i,QMD_r[i],QMD_t[i],QMD_t[i-12],QMD_cv1,QMD_cv2)

axes[ai,aj].plot(QMDH_r,QMDH_cv*1000./7/8.314*0.14,'s',color='green',label='QMD Hugoniot')
print(QMDH_cv*1000./7/8.314*0.14)
axes[ai,aj].plot(2.597,1737./7/8.314*0.140,'^',color='orange',label='1 bar 2273 K liquid Cv\n(TA2013)')
#axes[ai,aj].plot(1.e-4,0.838,'s',color='orange',label='1 bar 300 K Cv\n(Gillet)')
axes[ai,aj].set_ylim(1.,10.)
axes[ai,aj].set_xlim(0,10)

axes[ai,aj].set_ylabel('Specific heat capacity Cv (nR)',size=sfont)
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_title("QMD Cv",size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#--------------------------------
axes[0,0].legend(fontsize=sfont-5)
axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
axes[1,1].legend(fontsize=sfont-5)
[4.5706038  4.64758239 4.46716382 4.94828001 4.69328843 4.79432283
 4.80394515 4.33485687 4.26028386 4.22660573 4.42145778]
Out[19]:
<matplotlib.legend.Legend at 0xb287f6240>

Check the grid spacing compared to the phase boundaries

Colors correspond to temperature. Black lines are ANEOS phase boundaries.

Note that ANEOS by default puts a tension region in for the solid that extends to rhomin (V17) in the input file.

If the tension region is kept, it is visible as a kink connects to the low entropy extension of the melt curve in the lower left plot of density vs. specific entropy.

The lack of points below 1000 K in the vapor dome (seen in temperature vs. specific entropy upper left) corresponds to when the sublimation pressure reaches 1.E-30. At this point, ANEOS bottoms out the pressures at this value and fixes the other state variables (it looks like to constant values; will investigate this region more closely later).

The ANEOS triple point convergence is not perfect, and there are kinks in the tabulated phase boundaries right at the triple point.

In [20]:
# check the gridding of the table around the vapor curve

# Plot aneos vapor curves
sfont = 15
fig, axes = plt.subplots(nrows=5, ncols=2, figsize=(14,26))
plt.subplots_adjust(wspace=0.5)
tcolmin=0.
tcolmax=1.2*antcp
tpltmax=1.2*antcp
#-------------
axes[0,0].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[0,0].set_ylabel('Temperature [K]',size=sfont)
axes[0,0].tick_params(labelsize=sfont)

axes[0,0].set_ylim(0,tpltmax)
axes[0,0].set_xlim(0,25)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[0,0].plot(np.resize(ansarr[it,:],dsize)*1.e3,np.zeros(dsize)+antarr[it],'o',markersize=2,color=col)
    #print(ansarr[it,:])

if imc > -1:
    axes[0,0].plot(mcarr[:,7]/1.e3,mcarr[:,0],color="black")
    axes[0,0].plot(mcarr[:,8]/1.e3,mcarr[:,0],color="black")

axes[0,0].plot(vcarr[:,7]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[0,0].plot(vcarr[:,8]/1.e3,vcarr[:,0],color="black")
axes[0,0].plot(vcarr[0,7]/1.e3,vcarr[0,0],'ko')

#-------------
for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[0,1].plot(andarr,np.resize(anparr[it,:],dsize),'o',markersize=2,color=col)

axes[0,1].loglog(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[0,1].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[0,1].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[0,1].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[0,1].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")


axes[0,1].set_ylim(1.e-25,1000)
axes[0,1].set_xlim(1.e-20,10.)
#axes[0,1].set_ylim(1,500)
#axes[0,1].set_xlim(3,6.)

axes[0,1].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[0,1].set_ylabel('Pressure (GPa)',size=sfont)
axes[0,1].tick_params(labelsize=sfont)

#-------------

axes[1,0].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[1,0].set_ylabel('Pressure (GPa)',size=sfont)
axes[1,0].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[1,0].plot(np.resize(ansarr[it,:],dsize)*1.e3,np.resize(anparr[it,:],dsize),'o',markersize=2,color=col)

axes[1,0].semilogy(vcarr[:,7]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[1,0].semilogy(vcarr[:,8]/1.e3,vcarr[:,3],color="black")
axes[1,0].plot(vcarr[0,7]/1.e3,vcarr[0,3],'ko')
if imc > -1 :
    axes[1,0].plot(mcarr[:,7]/1.e3,mcarr[:,3],color="black")
    axes[1,0].plot(mcarr[:,8]/1.e3,mcarr[:,4],color="black")

axes[1,0].set_ylim(1.e-10,1000)
axes[1,0].set_xlim(0,15)

#-------------

axes[1,1].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[1,1].set_ylabel('Pressure (GPa)',size=sfont)
axes[1,1].tick_params(labelsize=sfont)


for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[1,1].plot(np.resize(anearr[it,:],dsize),np.resize(anparr[it,:],dsize),'o',markersize=2,color=col)

axes[1,1].semilogy(vcarr[:,5]/1.e6,vcarr[:,3],color="black",label=eosname)
axes[1,1].semilogy(vcarr[:,6]/1.e6,vcarr[:,3],color="black")
axes[1,1].plot(vcarr[0,5]/1.e6,vcarr[0,3],'ko')
if imc > -1:
    axes[1,1].plot(mcarr[:,5]/1.e6,mcarr[:,3],color="black")
    axes[1,1].plot(mcarr[:,6]/1.e6,mcarr[:,4],color="black")

axes[1,1].set_ylim(1.e-10,1000)
axes[1,1].set_xlim(0,25)



#-------------

axes[2,0].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[2,0].set_ylabel('Temperature (K)',size=sfont)
axes[2,0].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[2,0].plot(andarr,np.zeros(dsize)+antarr[it],'o',markersize=2,color=col)

axes[2,0].plot(vcarr[:,1]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[2,0].plot(vcarr[:,2]/1.e3,vcarr[:,0],color="black")
axes[2,0].plot(vcarr[0,1]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[2,0].plot(mcarr[:,1]/1.e3,mcarr[:,0],color="black")
    axes[2,0].plot(mcarr[:,2]/1.e3,mcarr[:,0],color="black")

axes[2,0].set_ylim(0.,20000)
axes[2,0].set_xlim(0,30.)


#-------------

axes[2,1].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[2,1].set_ylabel('Temperature (K)',size=sfont)
axes[2,1].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[2,1].loglog(andarr,np.zeros(dsize)+antarr[it],'o',markersize=2,color=col)

axes[2,1].loglog(vcarr[:,1]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[2,1].loglog(vcarr[:,2]/1.e3,vcarr[:,0],color="black")
axes[2,1].plot(vcarr[0,1]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[2,1].loglog(mcarr[:,1]/1.e3,mcarr[:,0],color="black")
    axes[2,1].loglog(mcarr[:,2]/1.e3,mcarr[:,0],color="black")

axes[2,1].set_ylim(10.,1.E8)
axes[2,1].set_xlim(1.E-10,100.)


#-------------

axes[3,1].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[3,1].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[3,1].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[3,1].semilogx(andarr,np.resize(ansarr[it,:],dsize)*1000.,'o',markersize=2,color=col)

axes[3,1].semilogx(vcarr[:,1]/1.e3,vcarr[:,7]/1.e3,color="black",label=eosname)
axes[3,1].semilogx(vcarr[:,2]/1.e3,vcarr[:,8]/1.e3,color="black")
axes[3,1].plot(vcarr[0,1]/1.e3,vcarr[0,7]/1.e3,'ko')
if imc > -1:
    axes[3,1].semilogx(mcarr[:,1]/1.e3,mcarr[:,7]/1.e3,color="black")
    axes[3,1].semilogx(mcarr[:,2]/1.e3,mcarr[:,8]/1.e3,color="black")

axes[3,1].set_ylim(0.,20)
axes[3,1].set_xlim(1.E-15,30.)

#-------------

axes[3,0].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[3,0].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[3,0].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[3,0].plot(andarr,np.resize(ansarr[it,:],dsize)*1000.,'o',markersize=2,color=col)

axes[3,0].plot(vcarr[:,1]/1.e3,vcarr[:,7]/1.e3,color="black",label=eosname)
axes[3,0].plot(vcarr[:,2]/1.e3,vcarr[:,8]/1.e3,color="black")
axes[3,0].plot(vcarr[0,1]/1.e3,vcarr[0,7]/1.e3,'ko')
if imc > -1:
    axes[3,0].plot(mcarr[:,1]/1.e3,mcarr[:,7]/1.e3,color="black")
    axes[3,0].plot(mcarr[:,2]/1.e3,mcarr[:,8]/1.e3,color="black")

axes[3,0].set_ylim(0.,10)
axes[3,0].set_xlim(0.,15.)



#-------------
ai=4
aj=1
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].semilogx(andarr,np.resize(ansarr[it,:],dsize)*1000.,'o',markersize=2,color=col)

axes[ai,aj].semilogx(vcarr[:,1]/1.e3,vcarr[:,7]/1.e3,color="black",label=eosname)
axes[ai,aj].semilogx(vcarr[:,2]/1.e3,vcarr[:,8]/1.e3,color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,7]/1.e3,'ko')
if imc > -1:
    axes[ai,aj].semilogx(mcarr[:,1]/1.e3,mcarr[:,7]/1.e3,color="black")
    axes[ai,aj].semilogx(mcarr[:,2]/1.e3,mcarr[:,8]/1.e3,color="black")

axes[ai,aj].set_ylim(0.,30)
axes[ai,aj].set_xlim(1.E-25,30.)

#-------------
ai=4
aj=0
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

tcolmax=40000.
for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].semilogx(andarr,np.resize(ansarr[it,:],dsize)*1000.,'o',markersize=2,color=col)

axes[ai,aj].semilogx(vcarr[:,1]/1.e3,vcarr[:,7]/1.e3,color="black",label=eosname)
axes[ai,aj].semilogx(vcarr[:,2]/1.e3,vcarr[:,8]/1.e3,color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,7]/1.e3,'ko')
if imc > -1:
    axes[ai,aj].semilogx(mcarr[:,1]/1.e3,mcarr[:,7]/1.e3,color="black")
    axes[ai,aj].semilogx(mcarr[:,2]/1.e3,mcarr[:,8]/1.e3,color="black")

axes[ai,aj].set_ylim(0.,200)
axes[ai,aj].set_xlim(1.E-25,30.)

#axes[0,0].legend(fontsize=sfont-5)
#axes[0,1].legend(fontsize=sfont-5)
#axes[1,0].legend(fontsize=sfont-5)
#axes[1,1].legend(fontsize=sfont-5)
/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_base.py:3507: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=1.0, top=1.0
  self.set_ylim(upper, lower, auto=None)
Out[20]:
(1e-25, 30.0)

ANEOS KPA FLAG

                            TABLE          ANEOS
 KPAQQ=STATE INDICATOR      =1, 1p    =1, 1p    (eos without melt)
                            =2, 2p lv =2, 2p liquid/solid plus vapor
                                      =4, 1p solid  (eos with melt)
                                      =5, 2p melt   (eos with melt)
                                      =6, 1p liquid (eos with melt)
                            =-1 bad value of temperature
                            =-2 bad value of density
                            =-3 bad value of material number

To resolve a melt curve, there should be sufficient numbers of points within the melt curve (KPA=5, red points) so that the melt curve is continuously sampled in the grid.

The pink region is where the vapor pressure is bottomed out at 1.E-30 GPa or the pressures are negative (if there is a tension region.)

In [21]:
# check the ANEOS quality flag for errors in the EOS surface
uniqkarr = np.unique(ankarr)
print("Unique values in the KPA flag array:", uniqkarr)
print("Value: # elements with this value")
#get_indexes = lambda x, xs: [i for (y, i) in zip(xs, range(len(xs))) if x == y]

for i in uniqkarr:
    ix = get_indexes(i,np.reshape(ankarr,dsize*tsize))
    print(i,': ',len(ix))


    
# Plot aneos vapor curves
sfont = 15
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(14,14))
plt.subplots_adjust(wspace=0.5)
kcolmin=1
kcolmax=7
#-------------


#-------------
ai=0
aj=0
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Temperature (K)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


for itt in range(1,tsize,1):
    for i in uniqkarr:
        ix = get_indexes(i,np.resize(ankarr[itt,:],dsize))
        icolscale = (i-kcolmin)/(kcolmax-kcolmin)
        col=local_cmaps.parula(icolscale)
        if i == 5:
            axes[ai,aj].plot(andarr[ix],np.full(len(ix),antarr[itt]),'o',markersize=5,color='red')
#            print(i,andarr[ix],antarr[itt])
        else:
            axes[ai,aj].plot(andarr[ix],np.full(len(ix),antarr[itt]),'o',markersize=2,color=col)


axes[ai,aj].plot(vcarr[:,1]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[ai,aj].plot(vcarr[:,2]/1.e3,vcarr[:,0],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,0],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,0],color="black")

axes[ai,aj].set_ylim(0.,20000)
axes[ai,aj].set_xlim(0,30.)


#-------------
ai=0
aj=1
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Temperature (K)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


for itt in range(1,tsize,1):
    for i in uniqkarr:
        ix = get_indexes(i,np.resize(ankarr[itt,:],dsize))
        icolscale = (i-kcolmin)/(kcolmax-kcolmin)
        col=local_cmaps.parula(icolscale)
        if i == 5:
            axes[ai,aj].plot(andarr[ix],np.full(len(ix),antarr[itt]),'o',markersize=5,color='red')
#            print(i,andarr[ix],antarr[itt])
        else:
            axes[ai,aj].plot(andarr[ix],np.full(len(ix),antarr[itt]),'o',markersize=2,color=col)


axes[ai,aj].loglog(vcarr[:,1]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,0],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[ai,aj].loglog(mcarr[:,1]/1.e3,mcarr[:,0],color="black")
    axes[ai,aj].loglog(mcarr[:,2]/1.e3,mcarr[:,0],color="black")

axes[ai,aj].set_ylim(10.,1.E8)
axes[ai,aj].set_xlim(1.E-22,100.)


#-------------
ai=1
aj=0
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


for itt in range(1,tsize,1):
    for i in uniqkarr:
        ix = get_indexes(i,np.resize(ankarr[itt,:],dsize))
        icolscale = (i-kcolmin)/(kcolmax-kcolmin)
        col=local_cmaps.parula(icolscale)
        if i == 5:
            axes[ai,aj].semilogy(andarr[ix],anparr[itt,ix],'o',markersize=5,color='red')
#            print(i,andarr[ix],antarr[itt])
        else:
            axes[ai,aj].semilogy(andarr[ix],anparr[itt,ix],'o',markersize=2,color=col)


axes[ai,aj].plot(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].plot(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(1.e-6,2000)
axes[ai,aj].set_xlim(0,13.)


#-------------
ai=1
aj=1
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Temperature (K)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


for itt in range(1,tsize,1):
    for i in uniqkarr:
        ix = get_indexes(i,np.resize(ankarr[itt,:],dsize))
        icolscale = (i-kcolmin)/(kcolmax-kcolmin)
        col=local_cmaps.parula(icolscale)
        if i == 5:
            axes[ai,aj].plot(andarr[ix],np.full(len(ix),antarr[itt]),'o',markersize=5,color='red')
#            print(i,andarr[ix],antarr[itt])
        else:
            axes[ai,aj].plot(andarr[ix],np.full(len(ix),antarr[itt]),'o',markersize=2,color=col)
    tmp = np.where(anparr[itt,:] < 0.)
    #tmp = np.resize(tmp,len(tmp))
    #print(itt,tmp)
    if (len(tmp[0]) > 0):
        axes[ai,aj].plot(andarr[tmp[0]],np.full(len(tmp[0]),antarr[itt]),'o',markersize=2,color='purple')
    tmp = np.where(anparr[itt,:]*1.e30 <= 2.)
    #tmp = np.resize(tmp,len(tmp))
    #print(itt,tmp)
    if (len(tmp[0]) > 0):
        axes[ai,aj].plot(andarr[tmp[0]],np.full(len(tmp[0]),antarr[itt]),'o',markersize=2,color='hotpink')

axes[ai,aj].loglog(vcarr[:,1]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[ai,aj].loglog(vcarr[:,2]/1.e3,vcarr[:,0],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[ai,aj].loglog(mcarr[:,1]/1.e3,mcarr[:,0],color="black")
    axes[ai,aj].loglog(mcarr[:,2]/1.e3,mcarr[:,0],color="black")


    
axes[ai,aj].set_ylim(10.,1.E8)
axes[ai,aj].set_xlim(1.E-22,100.)




#axes[1,0].axis("off")
#axes[1,1].axis("off")
Unique values in the KPA flag array: [2 4 5 6]
Value: # elements with this value
2 :  17376
4 :  30372
5 :  282
6 :  241796
Out[21]:
(1e-22, 100.0)
In [ ]:
 

Check the Melt Curve in Tabulated EOS

Colored lines correspond to isotherms. Black lines are ANEOS phase boundaries.

Tabulations of the equation of state can lead to erroneous material descriptions across the melt curve. In the following plots, the isotherms should be flat (constant pressure) across the phase boundary (black lines). Every isotherm in the table is shown in the plotted regions.

In [22]:
# CHECK MELT CURVE GRIDDING
sfont = 15
fig, axes = plt.subplots(nrows=5, ncols=2, figsize=(14,26))
plt.subplots_adjust(wspace=0.5)
tcolmin=0.
tcolmax=1.5*antcp
tpltmax=1.5*antcp

tskip=1
#-------------
ai=0
aj=0
axes[ai,aj].plot([],[],' ',label='Low pressure melt curve')

for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black",label=eosname)
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(.1,60)
axes[ai,aj].set_xlim(2.4,4.5)

#axes[0,1].set_ylim(1.e-10,50)
#axes[0,1].set_xlim(1.e-7,100)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


#-------------
ai=0
aj=1
axes[ai,aj].plot([],[],' ',label='High pressure melt curve')

for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black",label=eosname)
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(40.,150)
axes[ai,aj].set_xlim(3.9,5.4)

#axes[0,1].set_ylim(1.e-10,50)
#axes[0,1].set_xlim(1.e-7,100)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


#-------------
ai=1
aj=0
axes[ai,aj].plot([],[],' ',label='Higher pressure melt curve')

for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black",label=eosname)
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(180.,310)
axes[ai,aj].set_xlim(5.5,6.4)

#axes[0,1].set_ylim(1.e-10,50)
#axes[0,1].set_xlim(1.e-7,100)

axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


#-------------
ai=1
aj=1
axes[ai,aj].plot([],[],' ',label='Higher pressure melt curve')

axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(anearr[it,:],dsize),np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

if imc > -1:
    axes[ai,aj].plot(mcarr[:,5]/1.e6,mcarr[:,3],color="black",label=eosname)
    axes[ai,aj].plot(mcarr[:,6]/1.e6,mcarr[:,4],color="black")

#axes[1,1].set_ylim(1.e-10,200)
#axes[1,1].set_xlim(0,15)
axes[ai,aj].set_ylim(180.,310)
axes[ai,aj].set_xlim(7,18)

#-------------

ai=2
aj=0
axes[ai,aj].plot([],[],' ',label='Low pressure melt curve')

axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(ansarr[it,:],dsize)*1.e3,np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

if imc > -1 :
    axes[ai,aj].plot(mcarr[:,7]/1.e3,mcarr[:,3],color="black",label=eosname)
    axes[ai,aj].plot(mcarr[:,8]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(.1,50)
axes[ai,aj].set_xlim(2.6,3.6)
#axes[1,0].set_ylim(1.,200)
#axes[1,0].set_xlim(5,10)

#-------------

ai=2
aj=1
axes[ai,aj].plot([],[],' ',label='High pressure melt curve')

axes[ai,aj].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(ansarr[it,:],dsize)*1.e3,np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

if imc > -1 :
    axes[ai,aj].plot(mcarr[:,7]/1.e3,mcarr[:,3],color="black",label=eosname)
    axes[ai,aj].plot(mcarr[:,8]/1.e3,mcarr[:,4],color="black")

axes[ai,aj].set_ylim(50.,150)
axes[ai,aj].set_xlim(1.6,4)
#axes[1,0].set_ylim(1.,200)
#axes[1,0].set_xlim(5,10)

#-------------
ai=3
aj=0
axes[ai,aj].plot([],[],' ',label='Low pressure melt curve')

axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(anearr[it,:],dsize),np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

if imc > -1:
    axes[ai,aj].plot(mcarr[:,5]/1.e6,mcarr[:,3],color="black",label=eosname)
    axes[ai,aj].plot(mcarr[:,6]/1.e6,mcarr[:,4],color="black")

#axes[1,1].set_ylim(1.e-10,200)
#axes[1,1].set_xlim(0,15)
#axes[ai,aj].set_ylim(50.,150)
axes[ai,aj].set_xlim(1,6)
axes[ai,aj].set_ylim(.1,50)
#axes[ai,aj].set_xlim(6.,9.)

#-------------
ai=3
aj=1
axes[ai,aj].plot([],[],' ',label='High pressure melt curve')

axes[ai,aj].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)


for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(np.resize(anearr[it,:],dsize),np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

if imc > -1:
    axes[ai,aj].plot(mcarr[:,5]/1.e6,mcarr[:,3],color="black",label=eosname)
    axes[ai,aj].plot(mcarr[:,6]/1.e6,mcarr[:,4],color="black")

#axes[1,1].set_ylim(1.e-10,200)
#axes[1,1].set_xlim(0,15)
axes[ai,aj].set_ylim(50.,150)
axes[ai,aj].set_xlim(1,15)



#-------------
ai=4
aj=0
for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(anparr[it,:],dsize),'o',markersize=2,color=col,linestyle='-')

axes[ai,aj].plot(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].plot(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")


#axes[0,1].set_ylim(1.e-9,1000)
#axes[0,1].set_xlim(1.e-10,10.)
axes[ai,aj].set_ylim(300,700)
axes[ai,aj].set_xlim(6.5,8.)

axes[ai,aj].plot([],[],' ',label='Very high pressure melt curve.')
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#-------------
ai=4
aj=1
for it in range(1,tsize,tskip):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[ai,aj].plot(andarr,np.resize(anparr[it,:],dsize),'o',markersize=2,linestyle='-',color=col)

axes[ai,aj].plot(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[ai,aj].plot(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[ai,aj].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[ai,aj].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[ai,aj].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")


#axes[0,1].set_ylim(1.e-9,1000)
#axes[0,1].set_xlim(1.e-10,10.)
axes[ai,aj].set_ylim(700,1200)
axes[ai,aj].set_xlim(8.25,9.5)

axes[ai,aj].plot([],[],' ',label='Very high pressures')
axes[ai,aj].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[ai,aj].set_ylabel('Pressure (GPa)',size=sfont)
axes[ai,aj].tick_params(labelsize=sfont)

#------
axes[0,0].legend(fontsize=sfont-5)
axes[0,1].legend(fontsize=sfont-5)
axes[1,0].legend(fontsize=sfont-5)
axes[1,1].legend(fontsize=sfont-5)
#axes[4,1].axis("off")
axes[2,0].legend(fontsize=sfont-5)
axes[2,1].legend(fontsize=sfont-5)
axes[3,0].legend(fontsize=sfont-5)
axes[3,1].legend(fontsize=sfont-5)
axes[4,0].legend(fontsize=sfont-5)
axes[4,1].legend(fontsize=sfont-5)
Out[22]:
<matplotlib.legend.Legend at 0xb27796d68>

Example of bad gridding across the melt curve

The isotherms should be flat across the phase boundary, but the poor gridding leads to varying errors along the phase boundary. These errors would lead to energy errors and non-conservative behavior in the EOS model.

PLOT GADGET2 FORMAT TABLE: Entropy-Density grid

In [ ]:
 
In [23]:
# check the gridding of the gadget2 table

# Plot aneos vapor curves
sfont = 15
fig, axes = plt.subplots(nrows=4, ncols=2, figsize=(14,22))
plt.subplots_adjust(wspace=0.5)
tcolmin=0.
tcolmax=1.2*antcp
tpltmax=1.2*antcp
#-------------
axes[0,0].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[0,0].set_ylabel('Temperature [K]',size=sfont)
axes[0,0].tick_params(labelsize=sfont)

axes[0,0].set_ylim(0,tpltmax)
axes[0,0].set_xlim(0,25)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[0,0].plot(np.resize(ansarr[it,:],dsize)*1.e3,np.zeros(dsize)+antarr[it],'o',markersize=2,color=col)
    #print(ansarr[it,:])

if imc > -1:
    axes[0,0].plot(mcarr[:,7]/1.e3,mcarr[:,0],color="black")
    axes[0,0].plot(mcarr[:,8]/1.e3,mcarr[:,0],color="black")

axes[0,0].plot(vcarr[:,7]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[0,0].plot(vcarr[:,8]/1.e3,vcarr[:,0],color="black")
axes[0,0].plot(vcarr[0,7]/1.e3,vcarr[0,0],'ko')

#-------------
for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[0,1].plot(andarr,np.resize(anparr[it,:],dsize),'o',markersize=2,color=col)

axes[0,1].loglog(vcarr[:,1]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[0,1].loglog(vcarr[:,2]/1.e3,vcarr[:,4],color="black")
axes[0,1].plot(vcarr[0,1]/1.e3,vcarr[0,3],'ko')
if imc > -1:
    axes[0,1].plot(mcarr[:,1]/1.e3,mcarr[:,3],color="black")
    axes[0,1].plot(mcarr[:,2]/1.e3,mcarr[:,4],color="black")


axes[0,1].set_ylim(1.e-25,1000)
axes[0,1].set_xlim(1.e-20,10.)
#axes[0,1].set_ylim(1,500)
#axes[0,1].set_xlim(3,6.)

axes[0,1].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[0,1].set_ylabel('Pressure (GPa)',size=sfont)
axes[0,1].tick_params(labelsize=sfont)

#-------------

axes[1,0].set_xlabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[1,0].set_ylabel('Pressure (GPa)',size=sfont)
axes[1,0].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[1,0].plot(np.resize(ansarr[it,:],dsize)*1.e3,np.resize(anparr[it,:],dsize),'o',markersize=2,color=col)

axes[1,0].semilogy(vcarr[:,7]/1.e3,vcarr[:,3],color="black",label=eosname)
axes[1,0].semilogy(vcarr[:,8]/1.e3,vcarr[:,3],color="black")
axes[1,0].plot(vcarr[0,7]/1.e3,vcarr[0,3],'ko')
if imc > -1 :
    axes[1,0].plot(mcarr[:,7]/1.e3,mcarr[:,3],color="black")
    axes[1,0].plot(mcarr[:,8]/1.e3,mcarr[:,4],color="black")

axes[1,0].set_ylim(1.e-10,1000)
axes[1,0].set_xlim(0,15)

#-------------

axes[1,1].set_xlabel('Specific Energy (MJ/kg)',size=sfont)
axes[1,1].set_ylabel('Pressure (GPa)',size=sfont)
axes[1,1].tick_params(labelsize=sfont)


for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[1,1].plot(np.resize(anearr[it,:],dsize),np.resize(anparr[it,:],dsize),'o',markersize=2,color=col)

axes[1,1].semilogy(vcarr[:,5]/1.e6,vcarr[:,3],color="black",label=eosname)
axes[1,1].semilogy(vcarr[:,6]/1.e6,vcarr[:,3],color="black")
axes[1,1].plot(vcarr[0,5]/1.e6,vcarr[0,3],'ko')
if imc > -1:
    axes[1,1].plot(mcarr[:,5]/1.e6,mcarr[:,3],color="black")
    axes[1,1].plot(mcarr[:,6]/1.e6,mcarr[:,4],color="black")

axes[1,1].set_ylim(1.e-10,1000)
axes[1,1].set_xlim(0,25)



#-------------

axes[2,0].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[2,0].set_ylabel('Temperature (K)',size=sfont)
axes[2,0].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[2,0].plot(andarr,np.zeros(dsize)+antarr[it],'o',markersize=2,color=col)

axes[2,0].plot(vcarr[:,1]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[2,0].plot(vcarr[:,2]/1.e3,vcarr[:,0],color="black")
axes[2,0].plot(vcarr[0,1]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[2,0].plot(mcarr[:,1]/1.e3,mcarr[:,0],color="black")
    axes[2,0].plot(mcarr[:,2]/1.e3,mcarr[:,0],color="black")

axes[2,0].set_ylim(0.,20000)
axes[2,0].set_xlim(0,30.)


#-------------

axes[2,1].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[2,1].set_ylabel('Temperature (K)',size=sfont)
axes[2,1].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[2,1].loglog(andarr,np.zeros(dsize)+antarr[it],'o',markersize=2,color=col)

axes[2,1].loglog(vcarr[:,1]/1.e3,vcarr[:,0],color="black",label=eosname)
axes[2,1].loglog(vcarr[:,2]/1.e3,vcarr[:,0],color="black")
axes[2,1].plot(vcarr[0,1]/1.e3,vcarr[0,0],'ko')
if imc > -1:
    axes[2,1].loglog(mcarr[:,1]/1.e3,mcarr[:,0],color="black")
    axes[2,1].loglog(mcarr[:,2]/1.e3,mcarr[:,0],color="black")

axes[2,1].set_ylim(10.,1.E8)
axes[2,1].set_xlim(1.E-10,100.)


#-------------

axes[3,1].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[3,1].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[3,1].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[3,1].semilogx(andarr,np.resize(ansarr[it,:],dsize)*1000.,'o',markersize=2,color=col)

axes[3,1].semilogx(vcarr[:,1]/1.e3,vcarr[:,7]/1.e3,color="black",label=eosname)
axes[3,1].semilogx(vcarr[:,2]/1.e3,vcarr[:,8]/1.e3,color="black")
axes[3,1].plot(vcarr[0,1]/1.e3,vcarr[0,7]/1.e3,'ko')
if imc > -1:
    axes[3,1].semilogx(mcarr[:,1]/1.e3,mcarr[:,7]/1.e3,color="black")
    axes[3,1].semilogx(mcarr[:,2]/1.e3,mcarr[:,8]/1.e3,color="black")

axes[3,1].set_ylim(0.,15)
axes[3,1].set_xlim(1.E-8,30.)

#-------------

axes[3,0].set_xlabel('Density (g/cm$^3$)',size=sfont)
axes[3,0].set_ylabel('Specific Entropy (kJ/K/kg)',size=sfont)
axes[3,0].tick_params(labelsize=sfont)

for it in np.arange(tsize):
    icolscale = (antarr[it]-tcolmin)/(tcolmax-tcolmin)
    col=local_cmaps.parula(icolscale)
    axes[3,0].plot(andarr,np.resize(ansarr[it,:],dsize)*1000.,'o',markersize=2,color=col)

axes[3,0].plot(vcarr[:,1]/1.e3,vcarr[:,7]/1.e3,color="black",label=eosname)
axes[3,0].plot(vcarr[:,2]/1.e3,vcarr[:,8]/1.e3,color="black")
axes[3,0].plot(vcarr[0,1]/1.e3,vcarr[0,7]/1.e3,'ko')
if imc > -1:
    axes[3,0].plot(mcarr[:,1]/1.e3,mcarr[:,7]/1.e3,color="black")
    axes[3,0].plot(mcarr[:,2]/1.e3,mcarr[:,8]/1.e3,color="black")

axes[3,0].set_ylim(0.,10)
axes[3,0].set_xlim(0.,15.)



#axes[0,0].legend(fontsize=sfont-5)
#axes[0,1].legend(fontsize=sfont-5)
#axes[1,0].legend(fontsize=sfont-5)
#axes[1,1].legend(fontsize=sfont-5)
Out[23]:
(0.0, 15.0)

References

Andrault, D., Bolfan-Casanova, N., Bouhifd, M. A., Boujibar, A., Garbarino, G., Manthilake, G., ... & Pesce, G. (2017). Toward a coherent model for the melting behavior of the deep Earth’s mantle. Physics of the Earth and Planetary Interiors, 265, 67-81.

Asimow PD, Ghiorso MS (1998) Algorithmic Modifications Extending MELTS to Calculate Subsolidus Phase Relations. American Mineralogist 83, 1127-1131.

Centolanzi, F. J., & Chapman, D. R. (1966). Vapor pressure of tektite glass and its bearing on tektite trajectories determined from aerodynamic analysis. Journal of Geophysical Research, 71(6), 1735-1749.

Chase Jr, M. W., Curnutt, J. L., Downey Jr, J. R., McDonald, R. A., Syverud, A. N., & Valenzuela, E. A. (1982). JANAF thermochemical tables, 1982 supplement. Journal of Physical and Chemical Reference Data, 11(3), 695-940. https://janaf.nist.gov

Costa, G. C., Jacobson, N. S., & Fegley Jr, B. (2017). Vaporization and thermodynamics of forsterite-rich olivine and some implications for silicate atmospheres of hot rocky exoplanets. Icarus, 289, 42-55.

de Koker, N. P., Stixrude, L., & Karki, B. B. (2008). Thermodynamics, structure, dynamics, and freezing of Mg2SiO4 liquid at high pressure. Geochimica et Cosmochimica Acta, 72(5), 1427-1441.

Duffy, T., Madhusudhan, N., & Lee, K. K. M. (2015). 2.07 Mineralogy of Super-Earth Planets. Treatise on Geophysics, Second Edition, Elsevier, Oxford.Duffy, T., Madhusudhan, N., & Lee, K. K. M. (2015). 2.07 Mineralogy of Super-Earth Planets. Treatise on Geophysics, Second Edition, Elsevier, Oxford.

Fiquet, G., Auzende, A. L., Siebert, J., Corgne, A., Bureau, H., Ozawa, H., & Garbarino, G. (2010). Melting of peridotite to 140 gigapascals. Science, 329(5998), 1516-1518.

Gillet, P., Richet, P., Guyot, F., & Fiquet, G. (1991). High‐temperature thermodynamic properties of forsterite. Journal of Geophysical Research: Solid Earth, 96(B7), 11805-11816.

Ghiorso, Mark S., and Sack, Richard O. (1995) Chemical Mass Transfer in Magmatic Processes. IV. A Revised and Internally Consistent Thermodynamic Model for the Interpolation and Extrapolation of Liquid-Solid Equilibria in Magmatic Systems at Elevated Temperatures and Pressures. Contributions to Mineralogy and Petrology, 119, 197-212.

Kraus, R.G., Stewart, S.T., Swift, D.C., Bolme, C.A., Smith, R.F., Hamel, S., Hammel, B.D., Spaulding, D.K., Hicks, D.G., Eggert, J.H. and Collins, G.W. (2012). Shock vaporization of silica and the thermodynamics of planetary impact events. Journal of Geophysical Research: Planets, 117(E9), E09009, doi:10.1029/2012JE004082.

Luo, S. N., Akins, J. A., Ahrens, T. J., & Asimow, P. D. (2004). Shock‐compressed MgSiO3 glass, enstatite, olivine, and quartz: Optical emission, temperatures, and melting. Journal of Geophysical Research: Solid Earth, 109(B5).

Mysen, B. O., & Kushiro, I. (1988). Condensation, evaporation, melting, and crystallization in the primitive solar nebula; experimental data in the system MgO-SiO2-H2 to 1.0 X10-9 bar and 1870 degrees C with variable oxygen fugacity. American Mineralogist, 73(1-2), 1-19.

Nagahara, H., Kushiro, I., & Mysen, B. O. (1994). Evaporation of olivine: Low pressure phase relations of the olivine system and its implication for the origin of chondritic components in the solar nebula. Geochimica et cosmochimica acta, 58(8), 1951-1963.

Richet, P., Leclerc, F., & Benoist, L. (1993). Melting of forsterite and spinel, with implications for the glass transition of Mg2SiO4 liquid. Geophysical Research Letters, 20(16), 1675-1678.

Robie, R. A., Hemingway, B. S., & Takei, H. (1982). Heat capacities and entropies of Mg2SiO4, Mn2SiO4, and Co2SiO4 between 5 and 380 K. American Mineralogist, 67(5-6), 470-482.

Root, S., Townsend, J.P., Davies, E., Lemke, R.W., Bliss, D.E., Fratanduono, D.E., Kraus, R.G., Millot, M., Spaulding, D.K., Shulenburger, L. and Stewart, S.T. (2018). The principal Hugoniot of forsterite to 950 GPa. Geophysical Research Letters, 45(9), 3865-3872.

Thomas, C. W., & Asimow, P. D. (2013). Direct shock compression experiments on premolten forsterite and progress toward a consistent high‐pressure equation of state for CaO‐MgO‐Al2O3‐SiO2‐FeO liquids. Journal of Geophysical Research: Solid Earth, 118(11), 5738-5752.

Xiao, B., & Stixrude, L. (2018). Critical vaporization of MgSiO3. Proceedings of the National Academy of Sciences, 115(21), 5371-5376.

ANEOS references

Collins, Gareth S., and H. Jay Melosh (2014). Improvements to ANEOS for multiple phase transitions. 45th Lunar Planet. Sci. Conf. Abs. 2664.

Melosh, H. J. (2007). A hydrocode equation of state for SiO2. Meteoritics & Planetary Science, 42(12), 2079-2098.

Thompson, S. L. (1990). ANEOS analytic equations of state for shock physics codes input manual. SANDIA REPORT SAND, 89-2951.

Thompson, S. L., & Lauson, H. S. (1974). Improvements in the Chart D radiation-hydrodynamic CODE III: Revised analytic equations of state (No. SC-RR--71-0714). Sandia Labs.

Stewart, S. T. (2019). Update to ANEOS heat capacity limit. In prep.

ANEOS Input Parameters

EOS -1: low temperature solid model
THUG, RHUG: initial state for the Hugoniot calculated in ANEOS.OUTPUT

V01 nelem = 3: 3 elements
V02 model type=4: solid-liquid-gas model with ionization
V03 rho0=2.9 g/cm3: reference state approximaters the solid at the melting temperature (2163 K) at 1 bar. This value is chosen to get close to the right value for the liquid at the melting point.
V04 T0=2163 K: reference state is the solid at the melting temperature (2163 K) at 1 bar
V05 P0=1.e6 dynes/cm2: reference state is the solid at the melting temperature at 1 bar
V06 B0=0.5E12 dynes/cm2: bulk modulus is a compromise value to span the low and high pressure liquid region
V07 gamma0=0.8: fitted gamma0 to fit liquid region
V08 Tdebye=-625.0 K: fitted to match entropy of melting. Negative means use full Debye model. True value for forsterite solid is 768K.

V09 TG model=-1: Slater theory. The overall EOS topology is not sensitive to this model choice.
V10 3*C24=8.: Fitted value for gamma function to fit the liquid pressure-temperature liquid
V11 Esep=1.55E11 erg/g: Zero temperature separation energy. Fitted to match the triple point pressure.
V12 Tmelt=2163 K: Melting temperature at reference pressure.
V13 C53=0 erg/g: Critical point adjustment parameter. Not used.
V14 C54=0. [dimless]: Critical point adjustment parameter. Not used.
V15 H0=0: Thermal conduction parameter. Not used.
V16 C41=0: Thermal conduction parameter. Not used.

V17 rhomin=2.39 g/cm3: minimum density for the solid. Defines the tension region in the model. Try to have as small a tension region as possible. Set to near the triple point density. The default value is 0.8*rho0 when rhomin=0.
V18=0.0 g/cm3: Solid-solid phase transition parameter. Density at onset of transition. Not used.
V19=0.0 g/cm3: Solid-solid phase transition parameter. Density at end of transition. Not used.
V20=0.0 dynes/cm2: Solid-solid phase transition parameter. Pctr, pressure at the center of the transition. Not used.
V21=0.0: Solid-solid phase transition parameter. First derivative of Pctr with respect to density. Not used.
V22=0.0: Solid-solid phase transition parameter. Second derivative of Pctr with respect to density. Not used.
V23 Hfusion=1.0E10 erg/g: Latent heat of fusion at the reference pressure from lab measurements in Richet et al. 1993.
V24 rhol/rhos=0.942: Volume change on melting. Tweaked to match slope of the melt curve. True value 0.9053 based on MELTS model for forsterite at 1 bar.

V25 upper=0.0: Upper limit to cold compression curve extension. Default=1. Setting to zero means use default value.
V26 lower=0.: Default=0.
V27 alpha=0.01: Liquid model parameter ($0<\alpha<1$, default=0.3). Fitted to improve critical point.
V28 beta=0.1: Liquid model parameter ($0<\beta<1$, default=0.1). Fitted to improve critical point. beta cannot be equal to gamma.
V29 gamma=0.5: Liquid model parameter ($0<\gamma<1$, default=0.2). Fitted to improve critical point. beta cannot be equal to gamma.
V30 C60=0: Gamma model adjustment parameter. Default=0.
V31 C61=0: Gamma model adjustment parameter. Default=0.
V32 C62=0.4: Critical point adjustment parameter. Default=0 ($0<C63<1$). Fitted to improve critical point.

V33 Ionization model=0=Saha model.
V34-V35=0: Reactive chemistry model not used.
Melosh molecular clusters model for the critical point (Melosh fitted values for V36-V43):
V36 Natom=2: number of atoms in molecular clusters
V37 Ebind=4.25 eV: Binding energy
V38 RotDOF=2.0: Rotational degrees of freedom, 2 for diatomic molecule
V39 Rbond=1.5E-8 cm: Length of molecular bond (cm)
V40 VibDOF=1: Numer of vibrational degrees of freedom, 1 for diatomic molecule

V41 Tdebye=2000 K: Vibrational Debye temperature
V42 Mieflag=1: Flag for Mie potential (1) or Morse potential.
V43 a_exp=1.7: Power in Mie potential (1 to 2).
V44 Hc=1.35: Adjust heat capacity in high temperature limit. Cv=3HcNkT.
V45 QCC1: low density value to transition to ideal gas.
V45 QCC6: high temperature psi value to transition to ideal gas.
V46 to V48=0: Variables not used.

Z=8,12,14: Atomic numbers for Mg2SiO4.
Atomic Fractions=0.571,0.286,0.143: Atomic fractions for Mg2SiO4.

Development Notes

STSM 5/16/2019

Setting up development notebooks for pure forsterite.
True Debye temperature for crystalline forsterite is 768+-15 K (Robie et al. 1982).
Triple point of forsterite 5.2e-5 bar, 1890 C (2163 K).
Activation enthalpy of evaporation 543+-33 kJ/mol, and activation entropy of evaporation 169+-21 J/mol/K. (Nagahara et al. 1994). dH 543/0.140=3878.6 kJ/kg. dS 169/140=1207 kJ/kg.

STSM 5/23/2019
From Paul Asimow
I am using what is in MELTS, which is Berman for the solid and Lange for the liquid. Specifically, for liquid forsterite at 1890°C and 1 bar: rho = 2687 kg/m^3 For solid forsterite at 1890°C and 1 bar: 2968 kg/m^3 rhol/rhos = 0.90532

Richet et al. 1993 Enthalpy of melting: T=2174(100) K, dS=464(4.3) J/K/kg. dHmelt=1008736 J/kg = 1.0e10 erg/g

Thomas and Asimow 2013 liquid linear shock Hugoniot: rho0=2.597 g/cm3, T0=2273 K, c=2.67 km/s, s=1.64

Enthalpy of formation at 0 K from JANAF: 1.54E11 erg/g. Referenced to atomic gas at STP.

5/26/2019
Phase transition feature in ANEOS leads to a non-physical pressure-temperature discontinuity on the melt curve and dicontinuities in the sound speed and modulus in the liquid. Not using this feature.

5/27/2019
Wide-ranging EOS is a compromise to span low and high-pressure liquid regions and provide a realistic relationship between the entropies on the Hugoniot and the entropies of the low-pressure melt and partial vaporization regions.

6/4/2019
Added section to compare to shock-and-release-stagnation experiments with results from the Z machine.

6/6/2019
Added option to remove the tension region of the table and replace with sublimation. added extra grid points in the tension region.

7/10/2019
V2.0 Updated ANEOS to include a multiplicative scaling factor for the high temperature heat capacity limit. This term Hc is entered in V44. The heat capacity limit is 3HcNkT. There are two additional input parameters which define the transition to an ideal gas: V45=QCC1 and V46=QCC6.

7/11/2019
Updated ANEOS for the user-defined heat capacity using the full Debye function.

End of File